Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Nested IF statements using AND / OR
I have successfully nested IF statement in the past, but my current task is
frustrating me. I want to test for two conditions. if both are present, I want the results of a cell's value to X. If both aren't present, I want to test for a third condition. If the third condition is present, I want the cell's value to also be X. If neither the two conditions exist or the one condtion exists, I want the cell to display Y. Here is what my formula looks like =IF(((D1415) AND (G14="Y")),((I14*N14)/12),IF(C14.8,((I14*N14)/12),"")) The first part, the logical statement is coming back invalid. Can someone help? Thanks. -- Joe Schwartz |
#2
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Nested IF statements using AND / OR
AND (as well as OR, MOD, etc.) is not an operator as it is in most
programming languages... it is a function. So when you wrote this... (D1415) AND (G14="Y") it should have been this... AND(D1415,G14="Y") -- Rick (MVP - Excel) "Joe" (donotspam) wrote in message ... I have successfully nested IF statement in the past, but my current task is frustrating me. I want to test for two conditions. if both are present, I want the results of a cell's value to X. If both aren't present, I want to test for a third condition. If the third condition is present, I want the cell's value to also be X. If neither the two conditions exist or the one condtion exists, I want the cell to display Y. Here is what my formula looks like =IF(((D1415) AND (G14="Y")),((I14*N14)/12),IF(C14.8,((I14*N14)/12),"")) The first part, the logical statement is coming back invalid. Can someone help? Thanks. -- Joe Schwartz |
#3
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Nested IF statements using AND / OR
Syntax for AND is
AND(test1, test2, test3, ....) Your formula rewritten: =IF(OR(C140.8,AND(D1415,G14="Y"),(I14*N14)/12),"Y") -- Best Regards, Luke M *Remember to click "yes" if this post helped you!* "Joe" wrote: I have successfully nested IF statement in the past, but my current task is frustrating me. I want to test for two conditions. if both are present, I want the results of a cell's value to X. If both aren't present, I want to test for a third condition. If the third condition is present, I want the cell's value to also be X. If neither the two conditions exist or the one condtion exists, I want the cell to display Y. Here is what my formula looks like =IF(((D1415) AND (G14="Y")),((I14*N14)/12),IF(C14.8,((I14*N14)/12),"")) The first part, the logical statement is coming back invalid. Can someone help? Thanks. -- Joe Schwartz |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Too Many Nested IF Statements! | Excel Worksheet Functions | |||
Nested IF statements | Excel Discussion (Misc queries) | |||
Nested IF statements | Excel Discussion (Misc queries) | |||
Nested IF statements | Excel Worksheet Functions | |||
Do I need nested IF statements? | Excel Worksheet Functions |