testing more than one variable in an if statement

C

Charles

I would like to be able to test more than one variable in an if statement.
Such as the contents of a1 and the contents of a2. Is this possible?
 
P

Peo Sjoblom

=IF(OR(A1="x",A2="x"),"yes","no")

or

=IF(AND(A1="x",A2="x"),"yes","no")

depending on what you want
 
B

Biff

Hi!

Yes, this is possible but you need to provide more
specific info.

Here are a few things you can do:

=IF(OR(A1="",B2="")......
=IF(AND(A1="",B2="").....
=IF(A1="",IF(B2<>100.....

Biff
 
J

Jay

I would like to be able to test more than one variable in an if
statement. Such as the contents of a1 and the contents of a2. ...

Check out "logical" functions like AND and OR. Example:
=IF(AND(A1>3,A2<0),"good","bad")
 
Top