IF Function

H

hme

Hi

How should be IF function for the below mentioned request?
IF something is equal to 2 or 3 or 4 do something otherwise do another
things.

Thanks

hme
 
M

Marcus Fox

hme said:
Hi

How should be IF function for the below mentioned request?
IF something is equal to 2 or 3 or 4 do something otherwise do another
things.

=IF(something=2, do something, IF(something=3, do something, IF(something=4,
do something, do another thing)))
 
B

Bob Phillips

A function cannot do something, it can only return a value

=IF(OR(A1={1,2,3}),"do something","do something else")

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)
 
D

Dave Peterson

Do you mean in a formula?

If yes, you can do something like:
=IF(OR(A1=2,A1=3,A1=4),"2, 3 or 4","somethingelse")

Another equivalent method:
=IF(OR(A1={2,3,4}),"2, 3 or 4","somethingelse")
 
Top