ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Nested IF statements using AND / OR (https://www.excelbanter.com/excel-worksheet-functions/219901-nested-if-statements-using.html)

Joe[_13_]

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

Rick Rothstein

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



Luke M

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



All times are GMT +1. The time now is 03:23 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com