98.7% Of all customers recommend us, we're so confident about our results we publish all reviews and stats
View Live Stats View ReviewsForum home » Delegate support and help forum » Microsoft Excel Training and help » introduction excel training - If statement
introduction excel training - If statement
Resolved · Low Priority · Version Standard
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
Training information:
See also:
Welcome. Please choose your application (eg. Excel) and then post your question. Our Microsoft Qualified trainers will then respond within 24 hours (working days). Frequently Asked Questions
Any suggestions, questions or comments? Please post in the Improve the forum thread. |
Excel tip:Shared Conditional FormattingIn a shared workbook, conditional formats applied before the workbook was shared will continue to work; however you cannot modify the existing conditional formats or apply new ones. |