Multiple IF THEN criteria...

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!
 
J

Joe User

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 -----
 
J

Jason

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 -----
 

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