Nested IF statement

  • Thread starter Thread starter Lee
  • Start date Start date
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
 
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,"")
 
Back
Top