To use the Excel IF function with multiple conditions, put AND or OR inside the test. =IF(AND(C2>=D2,E2>=2),"Bonus","No bonus") returns Bonus only when both conditions are true. =IF(OR(C2<30000,E2<2),"Review","OK") returns Review when at least one is true. For more than two outcomes, nest one IF inside another or use IFS.
Every formula below runs on the same six-row table and shows the result for each row, so you can copy one, change the cell references and check it against your own data.
Excel IF function with multiple conditions: which formula to use
| Situation | Formula to copy |
|---|---|
| All conditions must be true | =IF(AND(C2>=D2,E2>=2),"Bonus","No bonus") |
| At least one condition is true | =IF(OR(C2<30000,E2<2),"Review","OK") |
| AND and OR together | =IF(AND(C2>=D2,OR(B2="East",E2>=3)),"Bonus","No bonus") |
| A value between two numbers | =IF(AND(C2>=35000,C2<=50000),"In range","Out of range") |
| More than two outcomes, any Excel version | =IF(C2>=60000,"Gold",IF(C2>=45000,"Silver",IF(C2>=35000,"Bronze","None"))) |
| More than two outcomes, Excel 2019 and later | =IFS(C2>=60000,"Gold",C2>=45000,"Silver",C2>=35000,"Bronze",TRUE,"None") |
| Count or sum rows that meet several conditions | =COUNTIFS(B2:B7,"East",C2:C7,">=50000") |
If your rule doesn't match any of these, describe it in plain words in our free Excel formula generator and it writes the formula for you.
The sample table used in every example
A small sales team in A1:E7. Sales and Target are numbers formatted as currency, and Years is how long each rep has been with the company.
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Rep | Region | Sales | Target | Years |
| 2 | Anna | East | $52,000 | $45,000 | 4 |
| 3 | Ben | West | $38,500 | $40,000 | 3 |
| 4 | Carla | East | $61,200 | $60,000 | 1 |
| 5 | David | North | $29,900 | $35,000 | 6 |
| 6 | Elena | West | $47,300 | $40,000 | 2 |
| 7 | Farid | North | $44,000 | $50,000 | 5 |
Type each formula in F2, press Enter, then double-click the fill handle (the small square in the bottom-right corner of the cell) to copy it down to row 7. The results are listed in row order, Anna to Farid.
Start with a basic IF statement in Excel
An IF statement in Excel has three parts: a test, the value to return when the test is true, and the value to return when it's false.
=IF(logical_test, value_if_true, [value_if_false])
1. One condition
=IF(C2>=D2,"Met","Missed")
Results: Met, Missed, Met, Missed, Met, Missed.
Text results go in straight double quotes. Numbers, cell references and TRUE/FALSE don't. Everything that follows is this same formula with a smarter test or a smarter result.
IF AND, IF OR and both together
2. IF AND: every condition must be true
A rep gets a bonus only if sales reached the target and they have been on the team at least 2 years.
=IF(AND(C2>=D2,E2>=2),"Bonus","No bonus")
Results: Bonus, No bonus, No bonus, No bonus, Bonus, No bonus.
Carla beat her target but has only 1 year, so the second condition fails and AND returns FALSE. Add more conditions by adding more arguments: AND(C2>=D2,E2>=2,B2="East").
3. IF OR: at least one condition is true
Flag a rep for review if sales are under $30,000 or they have less than 2 years of experience.
=IF(OR(C2<30000,E2<2),"Review","OK")
Results: OK, OK, Review, Review, OK, OK.
Carla is flagged for her 1 year, David for his $29,900. One true condition is enough.
To test one cell against several allowed values, repeat the comparison inside OR:
=IF(OR(B2="East",B2="West"),"Coastal","Inland")
Results: Coastal, Coastal, Coastal, Inland, Coastal, Inland. In Excel you can shorten the test to OR(B2={"East","West"}).
4. AND and OR in the same formula
Bonus if the target was met, and the rep is either in the East region or has 3 or more years.
=IF(AND(C2>=D2,OR(B2="East",E2>=3)),"Bonus","No bonus")
Results: Bonus, No bonus, Bonus, No bonus, No bonus, No bonus.
Elena met her target, but she is in West with 2 years, so the inner OR is FALSE. Read these formulas from the inside out: solve the OR first, then the AND.
5. Between two values
Excel has no "between" operator, so use two comparisons inside AND.
=IF(AND(C2>=35000,C2<=50000),"In range","Out of range")
Results: Out of range, In range, Out of range, Out of range, In range, In range.
Don't write 35000<=C2<=50000. Excel accepts it, but it doesn't mean what it does in math, and every row comes back "Out of range".
Nested IF and IFS: more than two outcomes
6. Nested IF
When there are three or more possible results, put another IF where the "false" value would go. Here sales decide a tier: $60,000 or more is Gold, $45,000 or more is Silver, $35,000 or more is Bronze.
=IF(C2>=60000,"Gold",IF(C2>=45000,"Silver",IF(C2>=35000,"Bronze","None")))
Results: Silver, Bronze, Gold, None, Silver, Bronze.

Excel checks the conditions from left to right and stops at the first one that is true, so order matters. With >=, start from the highest number. If you test C2>=35000 first, everyone above $35,000 becomes Bronze and the Gold and Silver tests are never reached.
Excel allows up to 64 nested IFs, but anything past three or four is hard to read and easy to break. For longer rules, use IFS or a lookup table (formulas 7 and 8), or let the Excel formula generator build the nesting from a description.
7. IFS: the same tiers without the nesting
=IFS(C2>=60000,"Gold",C2>=45000,"Silver",C2>=35000,"Bronze",TRUE,"None")
Results: Silver, Bronze, Gold, None, Silver, Bronze.
IFS takes pairs of test and result, and returns the result for the first test that is true. It has no "otherwise" argument, so the last pair TRUE,"None" works as the catch-all. Leave it out and David's row shows #N/A.
8. A lookup table instead of a long nested IF
If the tiers might change, keep them in cells instead of inside the formula. Put the minimum for each tier in H2:I5:
| H | I | |
|---|---|---|
| 1 | Minimum sales | Tier |
| 2 | 0 | None |
| 3 | 35000 | Bronze |
| 4 | 45000 | Silver |
| 5 | 60000 | Gold |
=XLOOKUP(C2,$H$2:$H$5,$I$2:$I$5,,-1)
=VLOOKUP(C2,$H$2:$I$5,2,TRUE)
Results (both): Silver, Bronze, Gold, None, Silver, Bronze.
Both return the tier for the largest minimum that is less than or equal to the sales figure. XLOOKUP needs Microsoft 365 or Excel 2021 or later. VLOOKUP works everywhere, but the table must be sorted from smallest to largest. More on the difference in XLOOKUP vs VLOOKUP.
More IF formulas with multiple conditions
9. Return a calculation instead of text
Pay 5% commission when the target is met and the rep has 2 or more years, 3% when only the target is met, and nothing otherwise.
=IF(AND(C2>=D2,E2>=2),C2*5%,IF(C2>=D2,C2*3%,0))
Results: 2,600, 0, 1,836, 0, 2,365, 0.
10. Handle blank cells first
Excel treats an empty cell as 0 in a comparison. If you fill formula 1 down past the data, an empty row shows "Met", because 0 is greater than or equal to 0. Check for the blank before anything else:
=IF(C2="","",IF(C2>=D2,"Met","Missed"))
Results: Met, Missed, Met, Missed, Met, Missed, and an empty cell for any row without a sales figure.
11. A whole column in one formula
In Microsoft 365 and Excel 2021 or later, one formula can return all six results at once. AND and OR can't be used for this, because they squeeze the whole range into a single TRUE or FALSE. Multiply the conditions for AND, add them for OR:
=IF((C2:C7>=D2:D7)*(E2:E7>=2),"Bonus","No bonus")
=IF((C2:C7<30000)+(E2:E7<2),"Review","OK")
Results: the same as formulas 2 and 3, spilled into F2:F7 from one cell. Keep each condition in its own parentheses.
12. Count or sum with multiple conditions
When you want a total instead of a label on every row, skip IF and use the functions built for conditions.
=COUNTIFS(B2:B7,"East",C2:C7,">=50000")
=SUMIFS(C2:C7,B2:B7,"West",E2:E7,">=2")
Results: 2 (Anna and Carla are in East with sales of $50,000 or more) and 85,800 (Ben's $38,500 plus Elena's $47,300).
All conditions in COUNTIFS, SUMIFS and AVERAGEIFS are joined with AND. To color the matching rows instead of labeling them, use the same tests in a conditional formatting rule.
IF formula errors and how to fix them
| What you see | Most likely cause | Fix |
|---|---|---|
#NAME? | Text without quotes, curly quotes pasted from a web page or document, a misspelled function, or IFS in Excel 2016 or older | Retype the quotes as straight ", check the spelling, use nested IF in old versions |
#N/A from IFS | No test was true | Add TRUE,"your default" as the last pair |
#VALUE! | A calculation such as C2*5% hit a cell that contains text | Fix the cell, or test it first with ISNUMBER(C2) |
| "You've entered too few arguments for this function" | The parenthesis that closes AND or OR is in the wrong place | Close it right after the last condition: AND(C2>=D2,E2>=2) |
| "There's a problem with this formula" on a correct formula | Your regional settings use ; between arguments | Replace the commas with semicolons |
FALSE in the cell | The third argument is missing | Add it, or "" for an empty result |
| Every row gets the same tier | Nested IF or IFS tests are in the wrong order | With >=, test the highest number first |
| The condition is always true or always false | Numbers stored as text, or a number typed in quotes such as C2>="45000" | Remove the quotes, and convert the cells with Convert to Number |
Three of these deserve a closer look, because Excel shows no error and the results just look wrong:
- Numbers stored as text. Excel treats any text as larger than any number, so a "52000" stored as text passes every
>=test. Look for the small green triangle in the cell's corner, select the cells, click the warning icon and choose Convert to Number. - Extra spaces and case.
B2="East"matches "east" and "EAST" because=ignores case, but it doesn't match "East " with a trailing space. Clean the column withTRIM, and useEXACT(B2,"East")when case has to match. - Wildcards.
B2="Nor*"looks for the literal textNor*, asterisk included. For "contains" tests use=IF(ISNUMBER(SEARCH("Nor",B2)),"Yes","No").
Excel 365 vs older versions, and Google Sheets
| Function or feature | Microsoft 365, Excel 2021, 2024, web | Excel 2019 | Excel 2016 and older | Google Sheets |
|---|---|---|---|---|
IF, AND, OR, NOT | Yes | Yes | Yes | Yes |
COUNTIFS, SUMIFS, AVERAGEIFS | Yes | Yes | Yes | Yes |
IFS | Yes | Yes | No, shows #NAME? | Yes |
XLOOKUP | Yes | No | No | Yes |
| Whole-column formulas that spill (formula 11) | Yes | No | No | Wrap in ARRAYFORMULA |
If the file will be opened in Excel 2016 or older, stay with nested IF and VLOOKUP. Formulas 1 to 6, 9, 10 and 12 work in every version since Excel 2007.
In Google Sheets, formulas 1 to 10 and 12 work as written, including IFS, which also returns #N/A when no condition is true. Use the long OR(B2="East",B2="West") form there, and write formula 11 as =ARRAYFORMULA(IF((C2:C7>=D2:D7)*(E2:E7>=2),"Bonus","No bonus")).
In both apps, the separator between arguments follows your regional settings. Where the comma is the decimal separator, formulas use semicolons: =IF(AND(C2>=D2;E2>=2);"Bonus";"No bonus").
Frequently Asked Questions
How many conditions can an IF function have? AND and OR accept up to 255 conditions each, you can nest up to 64 IF functions, and IFS takes up to 127 pairs of test and result. In practice, a formula with more than four or five conditions is easier to maintain as a lookup table.
How do I write an IF statement with 3 conditions? If all three must be true for one result, put them in one AND: =IF(AND(C2>=D2,E2>=2,B2="East"),"Yes","No"). If the three conditions lead to different results, nest the IFs or use IFS, as in formulas 6 and 7.
What is the difference between IF AND and nested IF? IF with AND or OR combines several tests into one yes-or-no answer, so there are two possible results. A nested IF checks tests one after another and can return a different result for each, so use it when there are three or more outcomes.
Is IFS better than nested IF? It's shorter and easier to read, with no pile of closing parentheses. Nested IF still wins when the workbook has to open in Excel 2016 or older, where IFS doesn't exist.
Can I use IF with dates and multiple conditions? Yes. Build the dates with DATE instead of typing them as text: =IF(AND(A2>=DATE(2026,1,1),A2<=DATE(2026,12,31)),"This year","Other").
Why does my IF formula return FALSE instead of a blank? The value_if_false argument is missing, so Excel returns the logical value FALSE. End the formula with "" to show an empty cell: =IF(C2>=D2,"Met","").
Describe the rule and let AI write the IF formula
Most IF mistakes come from small things: a parenthesis in the wrong place, tiers in the wrong order, a missing catch-all. CoreGPT for Excel lets you type the rule the way you would say it, for example "in column E, show whether each rep is above or below target", then writes the formula, fills it down the column and explains what it does. It's free to start and works in Excel for Windows, Mac and the web.
Use this formula and fill it down:
=IF(C2>=D2,"Above","Below")Try it: CoreGPT for Excel
Related reading:



