How-to recipes · Analysis
How to use IF with multiple conditions in Excel
Test two or more conditions in one IF formula with AND, OR and NOT, combine them, and return results for a whole column in Microsoft 365.
A single IF checks one thing: is the sales figure at least 50,000? Real rules usually depend on several things at once: a bonus requires high sales and a good customer rating; shipping is free if the order is large or the customer is a member. Writing these as nested IFs quickly becomes unreadable. The cleaner way is to put AND, OR and NOT inside the IF, so the condition reads almost like the business rule itself.
The example data
Five sales reps with their annual sales in B and customer rating (out of 5) in C. The rule: a rep earns a bonus if sales are at least 50,000 and the rating is at least 4.
Both conditions must be true: AND
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Rep | Sales | Rating | Bonus |
| 2 | Ana | 62000 | 4.5 | Bonus |
| 3 | Ben | 48000 | 4.8 | |
| 4 | Chloe | 55000 | 3.9 | |
| 5 | Dev | 71000 | 4.2 | |
| 6 | Eva | 39000 | 4.6 |
Ana has 62,000 in sales and a 4.5 rating, so both tests pass.
Result: Bonus
AND returns TRUE only if every condition inside it is TRUE. Copied down, the results are Bonus, No bonus, No bonus, Bonus, No bonus. Ben fails on sales, Chloe on rating, Eva on sales. You can put up to 255 conditions inside one AND.
At least one condition true: OR
Shipping is free if the order is 100 or more, or the customer is a member:
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Order | Amount | Member | Shipping |
| 2 | SO-101 | 85 | Yes | |
| 3 | SO-102 | 140 | No | |
| 4 | SO-103 | 60 | No | Paid |
SO-103 is only 60 and the customer is not a member, so shipping is charged.
Result: Paid
OR returns TRUE if any condition is TRUE. SO-101 qualifies through membership, SO-102 through the amount.
Combining AND and OR
Rules can be nested: a bonus if sales are at least 50,000 and the rating is at least 4, or if sales exceed 70,000 regardless of the rating:
=IF(OR(AND(B2>=50000,C2>=4),B2>70000),"Bonus","No bonus")Read it from the inside out, exactly like the sentence. Dev would qualify through either branch. Write such rules in a cell comment or next to the table, because the formula alone does not explain the business reason.
Excluding something: NOT
NOT reverses a condition. Everyone except the North region: =IF(NOT(A2="North"),...), which is the same as A2<>"North". NOT is most useful in front of functions that return TRUE/FALSE, such as NOT(ISBLANK(B2)) for B2 is filled in. XOR is the rarer exactly one of the conditions test.
Microsoft 365: the whole column in one formula
AND and OR combine everything into a single TRUE/FALSE, so they cannot test each row of a range separately. For array formulas, multiply conditions for AND and add them for OR:
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Rep | Sales | Rating | Bonus |
| 2 | Ana | 62000 | 4.5 | Bonus |
| 3 | Ben | 48000 | 4.8 | No bonus |
| 4 | Chloe | 55000 | 3.9 | No bonus |
| 5 | Dev | 71000 | 4.2 | Bonus |
| 6 | Eva | 39000 | 4.6 | No bonus |
Each comparison returns TRUE/FALSE per row; multiplying them gives 1 only when both are TRUE.
For OR logic use +: =IF((B2:B6>=100)+(C2:C6="Yes"),"Free","Paid"). Any non-zero number counts as TRUE. This is the same technique used in FILTER and in lookups with two criteria (How to look up a value with two criteria in Excel).
Counting and summing with several conditions
If you only need a count of the rows that meet several conditions, skip IF altogether: =COUNTIFS(B2:B6,">=50000",C2:C6,">=4") counts the bonus winners directly. See Counting and summing with criteria: COUNTIFS, SUMIFS, SUMPRODUCT.
Pitfalls
- Writing conditions in plain language.
=IF(B2>=50000 AND C2>=4,...)is not valid Excel; AND is a function with the conditions as arguments. - Text comparisons are not case-sensitive ("yes" equals "Yes") but spaces count. A value of
Yesfails the test. - Numbers stored as text compare as text:
"62000">=50000is TRUE for the wrong reason (text is always greater than numbers). Make sure the column holds real numbers. - Empty cells count as 0 in numeric tests, so an empty rating passes
C2<4. AddC2<>""if blanks should be treated separately. - AND inside array formulas collapses the result to one value. Use
*and+as shown above.