Excel Formula for Multiple IFs (Nested IF & IFS)

Formulas & functions · Updated November 22, 2026

The direct answer: use the IFS function for most multiple-condition logic, or nest IF functions when you need different results per condition. For example, =IFS(A1>90,"A",A1>80,"B",A1>70,"C",TRUE,"F") assigns letter grades based on a score in A1.

Why Multiple IFs Are Needed

Excel’s basic IF function checks one condition and returns one of two results. Real data rarely fits that binary pattern. You might need to categorize sales tiers, apply shipping costs based on weight, or flag overdue invoices with different messages. That’s where multiple IFs come in. Before Excel 2016, users had to nest IF functions inside each other, which worked but got messy beyond a few conditions. The IFS function, introduced in Excel 2016 and available in Microsoft 365, evaluates conditions in order and returns the value for the first true condition, without deep nesting.

How Nested IF Works

Nested IF places one IF inside another’s value_if_false argument. The layout: =IF(condition1, result1, IF(condition2, result2, IF(condition3, result3, default))). With scores in A1, a grade formula looks like: =IF(A1>=90,"A",IF(A1>=80,"B",IF(A1>=70,"C",IF(A1>=60,"D","F")))). For a score of 85, Excel checks 85>=90 (false), then 85>=80 (true), so returns “B”. Each nested IF adds a closing parenthesis, and Excel limits nesting to 64 levels—plenty for most tasks, but hard to read and maintain. A common mistake is reversing the order of conditions; since Excel stops at the first true condition, you must test from highest to lowest (or most specific to least) to get correct results.

Using the IFS Function

The IFS function is cleaner: =IFS(condition1, result1, condition2, result2, ..., [default]). It evaluates conditions left to right and returns the result for the first true one. For the same grades, with score in A1: =IFS(A1>=90,"A",A1>=80,"B",A1>=70,"C",A1>=60,"D",TRUE,"F"). The final TRUE acts as a catch-all for any score below 60. If no condition is true and you omit the TRUE default, IFS returns a #N/A error. IFS is available in Excel 2016, 2019, 2021, and Microsoft 365, but not in Excel 2013 or earlier. On Excel for the web, IFS works the same as in the desktop version.

Choosing Between Nested IF and IFS

  • Use IFS when you have 3 or more conditions and want readable, short formulas.
  • Use nested IF when you need different outcomes that aren’t simple true/false per condition, or when you’re on Excel 2013 or older.
  • Use IFS with a TRUE default to avoid #N/A errors.
  • Use nested IF if you need to perform calculations inside each branch that depend on earlier conditions.

For example, a shipping cost formula with weight in B2: =IFS(B2<=1,5,B2<=5,8,B2<=10,12,TRUE,20) returns $5 for up to 1 kg, $8 for 1-5 kg, $12 for 5-10 kg, and $20 for heavier items. Nested IF would require =IF(B2<=1,5,IF(B2<=5,8,IF(B2<=10,12,20)))—both work, but IFS is shorter and less error-prone.

Common Problems and Fixes

  • #N/A error: IFS returns this if no condition is true and no TRUE default is given. Add ,TRUE,default at the end.
  • Wrong results due to condition order: Always order conditions from most restrictive to least. Test with a few values.
  • Too many nested IFs: Excel caps at 64, but readability suffers earlier. Switch to IFS or a lookup table.
  • Text vs. number mismatches: If your conditions compare text, ensure the data has no extra spaces. Use TRIM if needed.
  • Parentheses balance: In nested IF, count closing parentheses. Excel highlights matching parentheses as you type.

For a quick fix, use Excel’s Formula Evaluator (Formulas tab > Evaluate Formula) to step through each condition and see where the logic fails.

Alternatives: VLOOKUP and SWITCH

Sometimes multiple IFs aren’t the best tool. For mapping codes to values (like region names), a VLOOKUP or XLOOKUP against a lookup table is easier to maintain. With region codes in A2 and a table with codes in D2:E5, =VLOOKUP(A2,$D$2:$E$5,2,FALSE) returns the region name. XLOOKUP (Excel 2021/365) is simpler: =XLOOKUP(A2,$D$2:$D$5,$E$2:$E$5). For exact-match checks with a limited set, SWITCH works: =SWITCH(A2,"CA","California","NY","New York","Unknown"). SWITCH is available in Excel 2016 and later, but only for exact matches, not ranges. For ranges, IFS or nested IF remain necessary.

Frequently Asked Questions

Can I use AND or OR inside multiple IFs?

Yes. Combine conditions with AND or OR inside an IF: =IF(AND(A1>10,B1<5),"Yes","No"). In IFS, you can also use them: =IFS(AND(A1>10,B1<5),"Yes",TRUE,"No"). This lets you test multiple criteria at once.

Why does my IFS formula return #N/A even with a default?

If you included TRUE as the last condition, it should catch everything. But if you placed TRUE before other conditions, it will always be true and return its result prematurely. Also ensure you didn’t accidentally use a comma instead of a semicolon (in some regional settings, Excel uses semicolons as argument separators).

How many IFs can I nest in Excel?

Excel allows up to 64 nested IF functions. However, formulas with more than a few levels are hard to debug. For more than 5–6 conditions, consider IFS or a lookup table.

Does IFS work in Excel 2013?

No. IFS was introduced in Excel 2016. If you use Excel 2013, you must nest IF functions. Alternatively, use a lookup table with VLOOKUP, which works in all versions.

What’s the difference between IFS and SWITCH?

IFS evaluates a series of conditions (each can be any logical test) and returns the result for the first true one. SWITCH compares a single expression to a list of values and returns a matching result. Use IFS for ranges or complex conditions, SWITCH for exact value matches.

Can I use multiple IFs to return blank cells?

Yes, use empty double quotes: =IF(A1>10,"","Low") returns a blank-looking cell if A1>10. In IFS, use "" as a result: =IFS(A1>10,"",TRUE,"Low"). Note that the cell contains an empty string, not truly blank, which can affect COUNTIF functions.

Related

Try it: the Formula Explainer: paste any formula and see each function and reference in plain English.

More in Formulas & functions

Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources

Spotted an error in this guide? Let us know.