IF Statement Error
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hello
I need help with a multiply nested 'IF' statement pls. Thinking it should be straight forward as I've done a few of these before however I can't resolve this one.
In excel, the formula is =IF(OR(B2="",B2=0,C2="CLN"),A2,B2)
Where in my attachments
A = F_Amount
B = F_NNDXFLW
C = Strategy Type
My formula is
IF [F_NNDXFLW] = "" THEN [F_AMOUNT]
ELSEIF [F_NNDXFLW] = "0" THEN [F_AMOUNT]
ELSEIF [Strategy Type] = "CLN" THEN [F_AMOUNT]
ELSE [F_NNDXFLW]
Before I type in 'ENDIF' there doesn't appear to be any errors in my formula but when I add 'ENDIF' I get a parse error.
Any assistance would be much appreciated.
Thanks
Sures
Solved! Go to Solution.
- Labels:
- Parse
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @sureslala
What's the data type of F_NNDXFLW? I suspect it's numeric and you're trying to treat it as a string. If it's numeric, change it to:
IF isempty([F_NNDXFLW]) THEN [F_AMOUNT]
ELSEIF [F_NNDXFLW] = 0 THEN [F_AMOUNT]
ELSEIF [Strategy Type] = "CLN" THEN [F_AMOUNT]
ELSE [F_NNDXFLW]
ENDIF
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @sureslala if you update the syntax to this because you don't use commas for numeric arugments and ISEMPTY or ISNULL is a better function to test if a field is empty/null it should work without error.
IF Isempty([F_NNDXFLW]) THEN [F_AMOUNT]
ELSEIF [F_NNDXFLW] = 0 THEN [F_AMOUNT]
ELSEIF [Strategy Type] = "CLN" THEN [F_AMOUNT]
ELSE [F_NNDXFLW]
ENDIF
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @sureslala
Change the formula to below. [F_NNDXFLW] is numeric so the previous logic is for string and wont work.
Hope this helps : )
