Nested IF statement

L

Lee

I am trying to create a nested conditional statement.
This is what I've written:

=IF(if(b2=1,"1"," "),(W2<>W3,1," "))

Basically, I want to look first at cell b2 to determine if
it contains a 1; if no, it should put a null in cell A2
and stop; if yes, then it needs to determine if cell W2
and W3 are equal, and put a 1 in cell A2 if not equal.

Thanks, Lee
 
H

Harlan Grove

I am trying to create a nested conditional statement.
This is what I've written:

=IF(if(b2=1,"1"," "),(W2<>W3,1," "))

Basically, I want to look first at cell b2 to determine if
it contains a 1; if no, it should put a null in cell A2
and stop; if yes, then it needs to determine if cell W2
and W3 are equal, and put a 1 in cell A2 if not equal.

Picky: don't use 'null' carelessly. Excel has a #NULL! error value, which would
be the more obvious candidate to be called 'null'. Also, if you want nothing to
appear, use a zero length string, "", rather than a string of spaces, " ". Zero
length strings are easier to deal with in down stream calculations.

Less picky: "1" isn't TRUE. NEVER use text strings as first arguments to IF.

The most efficient way to do what you want is

=IF(AND(B2=1,W2<>W3),1,"")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top