Someone asked a human this. So we asked the AI.
Excel IF Formula With Multiple Conditions (With Examples)
One condition was apparently too few, and now Excel has to make a decision on several things at once.
The answer
To test multiple conditions in Excel, put AND or OR inside the IF function: =IF(AND(condition1, condition2), value_if_true, value_if_false). Use AND when all conditions must be true, OR when at least one must be true, and nested IFs (or IFS) when you need different results for different cases.
All conditions must be true (AND)
=IF(AND(A2>=50, B2>=50), "Pass", "Fail")
Returns "Pass" only if both A2 and B2 are 50 or more.
Any condition can be true (OR)
=IF(OR(A2="Yes", B2="Yes"), "Approved", "Rejected")
Returns "Approved" if A2 or B2 is "Yes".
Different result for several ranges (nested IF)
=IF(A2>=90, "A", IF(A2>=80, "B", IF(A2>=70, "C", "F")))
Excel checks from left to right and stops at the first true test, so order the tests from highest to lowest (or most specific first).
Same thing with IFS (Excel 2019, Microsoft 365 and Excel for the web)
=IFS(A2>=90, "A", A2>=80, "B", A2>=70, "C", TRUE, "F")
The final TRUE, "F" acts as the "everything else" result. Without it, IFS returns #N/A when nothing matches.
Combining AND and OR
=IF(AND(A2>=50, OR(B2="Yes", C2="Yes")), "OK", "No")
This requires A2 of at least 50 and either B2 or C2 to be "Yes".
Google Sheets works the same way for IF, AND, OR and IFS.
Steps:
- Click the cell for the result.
- Type the formula starting with
=. - Put text results in double quotes; numbers and cell references need none.
- Press
Enter, then drag the fill handle down to copy it.
Example
Bonus rule: a salesperson gets a bonus if sales in B2 are over 10000 AND they are in region "North" in C2.
=IF(AND(B2>10000, C2="North"), "Bonus", "No bonus")
With B2 = 12000 and C2 = North, the result is Bonus. With B2 = 12000 and C2 = South, the result is No bonus.
If either region North or South qualifies, use OR on the region:
=IF(AND(B2>10000, OR(C2="North", C2="South")), "Bonus", "No bonus")
Where people go wrong
Writing
A2>50 AND B2>50orIF(A2>50, B2>50). AND is a function:AND(A2>50, B2>50).Using a range like
A2>10 and <20. Each condition needs its own full test:AND(A2>10, A2<20).Ordering nested IFs wrongly. With
IF(A2>=70, "C", IF(A2>=90, "A", ...))a 95 returns "C" because the first true test wins. Start with the strictest.Forgetting quotes around text, as in
C2=North, which causes #NAME?. WriteC2="North".Mismatched brackets in nested IFs. Each IF needs its own closing bracket, all at the end.
The prompt you could have used
I'm in Excel. Write an IF formula: if B2 is over 10000 and C2 is "North" or "South", return "Bonus", otherwise "No bonus". Explain how AND and OR combine, and show an IFS version for grades.
Updated 2 November 2026. Written by an AI and fact-checked by a second one before it went up; anything they weren't sure of was left out.
Someone asked you something like this? Send them a link →
More questions nobody needed to ask
- How to Fix the #N/A Error in Excel (Causes and Fixes)
- How to Use SUMIF in Excel (With Examples)
- Percentage Change Between Two Numbers in Excel
- How to Concatenate Strings in Excel (With Examples)
- How to Delete a Git Branch (Local and Remote)
More Excel questions · All questions · Just Fucking Prompt It