Multiple IF THEN criteria...

  • Thread starter Thread starter Jason
  • Start date Start date
J

Jason

=IF(B20="r","-2",IF(B20="5","-1",IF(B20="=","1","")))

The "5" displays blank, all the others work... any reason why?

I am trying to be get so if in B20 someone enter's r "-2" diplays; 5 "-1"
diplays; = "-2" diplays; and if they enter nothing then nothing displays.

thank you!
 
Jason said:
=IF(B20="r","-2",IF(B20="5","-1",IF(B20="=","1","")))
The "5" displays blank, all the others work

Perhaps B20 contains the __number__ 5, not the __text__ "5". If so, you
should write:

=IF(B20="r","-2",IF(B20=5,"-1",IF(B20="=","1","")))

But I wonder if you want the __numbers__ -2, -1 and 1, not text. If so, you
should write:

=IF(B20="r",-2,IF(B20=5,-1,IF(B20="=",1,"")))


----- original message -----
 
That was it! good catch and thanks!

Joe User said:
Perhaps B20 contains the __number__ 5, not the __text__ "5". If so, you
should write:

=IF(B20="r","-2",IF(B20=5,"-1",IF(B20="=","1","")))

But I wonder if you want the __numbers__ -2, -1 and 1, not text. If so, you
should write:

=IF(B20="r",-2,IF(B20=5,-1,IF(B20="=",1,"")))


----- original message -----
 
Back
Top