I need an if statement that can handle 3 variables.
Example:
If A1="X" then 1
If A1="Y" then 2
If A1="Z" then 3
With standard if then I can only 2 outcomes.
I need an if statement that can handle 3 variables.
Example:
If A1="X" then 1
If A1="Y" then 2
If A1="Z" then 3
With standard if then I can only 2 outcomes.
=IF(A1="X,1,IF(A1="Y",2,IF(A1="Z",3,4)))
Regards
Trevor Shuttleworth - Retired Excel/VBA Consultant
I dream of a better world where chickens can cross the road without having their motives questioned
'Being unapologetic means never having to say you're sorry' John Cooper Clarke
=MATCH(A1,{"X","Y","Z"},0)
the X,Y,Z options are in order of what should correspond to 1,2,3.
or assuming those are three only choices.
=IF(A1="X",1,IF(A1="Y",2,3))
Where there is a will there are many ways.
If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner
Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks