PDA

View Full Version : Excel question



MattR
1st May 2006, 14:35
Is it possible (I think so but i can't seem to get the formula correct) to put a formula in a cell to look at another cell that has three possible outputs. The formula needs to output one answer for 2 of the outcomes and another for the other answer. I can use the if formula to choose between the two outcomes but I can't seem to get and if/or.


a1 can be say 1,2 or 3

if it's 1 or 2 then i want "yes" output
if it's 3 then "no"

I know how to do if (a1=1,"yes","no") but can't get formula to work for first bit to be if a1=1 or 2

Hope that makes sense!

MarcusMel
1st May 2006, 14:39
=If(And(cond1,cond2,..),True,False)
=If(Or(cond1,cond2,...),True,False)

Not sure I understand the problem to answer it.

MattR
1st May 2006, 14:48
Thanks Mmarcus, let me see if i can explain it better.


Using an example....


In cell A1 i will input a figure, for ease of explanation lets say it will be either 1,2 or 3

If it is 1 or 2 then I want an output of the word Yes in b1
If it is 3 then I want an output of No in b1

so i'm looking for the correct formula to place in b1

MarcusMel
1st May 2006, 14:52
=if(Or(A1=1,A1=2),"Yes","No")

MarcusMel
1st May 2006, 14:53
Or more precisely

=if(Or(A1=1,A1=2),"Yes",If(A1=3,"No","Foul input"))

MattR
1st May 2006, 15:04
Thanks a lot Marcus. Much appreciated.