If Statement to display 3 different outputs instead of 2

M

MikeyB

I am trying to use an if statement to get 1 of a possible 3 inputs and then
display in a more human friendly manner, for example.

The 3 inputs are:

p
n
o

If someone types in p then I would like to have Passed displayed, f should
display failed and o should display other. It works great if there are just
2 options but I cannot seem to find a solution for 3 variables.
 
J

Jacob Skaria

Try

=IF(A1="P","Passed",(IF(A1="f","Failed",IF(A1="o","Other",""))))

If this post helps click Yes
 
M

MikeyB

Wow, thanks Jacob, that got it working a treat!

Jacob Skaria said:
Try

=IF(A1="P","Passed",(IF(A1="f","Failed",IF(A1="o","Other",""))))

If this post helps click Yes
 
M

Max

One easier way to tackle the several options is via using VLOOKUP
Assuming the data: p, f, o (presume you had a typo when you said: n ?)
would be entered in A2 down
you could have this in B2:
=IF(A2="","",VLOOKUP(A2,{"p","Passed";"f","Failed";"o","Other"},2,0))
Copy B2 down as far as required
aloha? hit the YES below
--
Max
Singapore
http://savefile.com/projects/236895
Downloads:27,000 Files:200 Subscribers:70
xdemechanik
 

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