Nick has attended:
Access Introduction course
If statement
HI
Is it possible to build TWO criteria into an IF Statement? - i.e. if cellA = Yes, and if cellB = Yes, return Y, otherwise returnZ)
Cheers
NICK
Multiple IF statements in Microsoft Excel
Hi Nick,
Yes it is possible, by using Excel's logical AND() function. Like this:
IF (AND(cellA="Yes", cellB="Yes"), "Y", "Z")
Syntax is:
=if(logical_test,value_if_true,value_if_false)
Hope this answers your excel question.
Regards, Rich
RE: If statement
Hi Nick,
Yes this is possible. In the expression below I am looking to see if cell A1 contains the value "a" AND cell B1 contains the value "b". If they are both true then it will give back yes, but if it is not true for one or the other it will come back and say no.
=if(A1="a",if(B1="b","Yes","No"),"No")
Alternatively in this case you could use and AND function:
=(if(AND(A1="a",B1="b"),"Yes","No")
An If statement can have up to 7 Ifs contained in it. Just make sure that you know how many brackets and commas you're putting in!!
I hope this has answered your question.
Regards,
Caroline