Nested IF vs IFS: Which Is Better?
By ExcelReady TeamUpdated 8 min read
The short answer
IFS is better for most new formulas with three or more results: it lists each test and result in order, with no nested brackets. Nested IF is better when the file must work in Excel 2016 or older, or when you need a built-in "otherwise" result. With IFS, add TRUE as the last test to catch everything else.
Key takeaways
- Both check tests in order and stop at the first one that is TRUE, so put the strictest test first.
- IFS has no "otherwise" result. Add TRUE and a value as the last pair, or it returns #N/A when nothing matches.
- IFS needs Excel 2019 or later, including Microsoft 365. Nested IF works in every version.
- For many bands, a small lookup table with XLOOKUP or VLOOKUP is easier to maintain than either.
On this page+
The short answer to nested IF vs IFS: IFS is easier to read when a formula has three or more possible results, while nested IF works in every version of Excel and has a built-in "otherwise" result. Both check their tests in order and stop at the first TRUE. This guide is for anyone writing grade bands, commission rates or status labels who wants the clearest formula.
Nested IF vs IFS at a glance#
IFS replaces a chain of IFs with one flat list of tests and results.
| Feature | Nested IF | IFS |
|---|---|---|
| Syntax | =IF(test1, value1, IF(test2, value2, else)) | =IFS(test1, value1, test2, value2, ...) |
| Brackets | One extra pair per level | One pair in total |
| "Otherwise" result | Built in (the last value_if_false) | None: add TRUE, value as the last pair |
| If nothing matches | Returns the last value_if_false | Returns #N/A |
| Order of tests | First TRUE wins | First TRUE wins |
| Limit | 64 nested IFs | 127 test and value pairs |
| Excel versions | All versions | Excel 2019 and later, including Microsoft 365 |
How the syntax differs#
A nested IF puts a new IF inside the value_if_false part of the one before it. IFS just lists the pairs.
=IF(logical_test, value_if_true, value_if_false)
=IFS(logical_test1, value_if_true1, [logical_test2, value_if_true2], ...)In a nested IF, Excel reads the first test. If it is TRUE, you get the first value. If not, Excel moves into the next IF, and so on, until the final value_if_false. IFS does the same thing, reading pairs from left to right, but without the nesting. The IF function guide and the IFS function guide cover each argument in detail.
The same grading formula written both ways#
Here is a list of test scores. The grade bands are A for 90 or more, B for 80 or more, C for 70 or more, and F for anything lower.
| A | B | C | |
|---|---|---|---|
| 1 | Student | Score | Grade |
| 2 | Ana | 94 | A |
| 3 | Ben | 81 | B |
| 4 | Cara | 67 | F |
| 5 | Dev | 75 | C |
| 6 | Eli | 88 | B |
| 7 | Fay | 59 | F |
With nested IF#
=IF(B2>=90,"A",IF(B2>=80,"B",IF(B2>=70,"C","F")))Three IFs, three closing brackets at the end. For Ana's 94, the first test is TRUE, so the result is A. For Cara's 67, all three tests are FALSE, so she gets the final value_if_false, F.
With IFS#
=IFS(B2>=90,"A",B2>=80,"B",B2>=70,"C",TRUE,"F")The same four results, with one pair of brackets. The last pair, TRUE,"F", is the "otherwise": TRUE always passes, so any score that reached it gets F. Fill either formula down to C7 with Ctrl+D (⌘D on a Mac) and you get the grades in the table above.
Adding a band later#
Say the school adds a Resit grade for scores from 60 to 69. In IFS you add one pair before the TRUE:
=IFS(B2>=90,"A",B2>=80,"B",B2>=70,"C",B2>=60,"Resit",TRUE,"F")In a nested IF you add a fourth IF inside the third one, and a fourth closing bracket at the end:
=IF(B2>=90,"A",IF(B2>=80,"B",IF(B2>=70,"C",IF(B2>=60,"Resit","F"))))Both now give Cara's 67 Resit and Fay's 59 F. The IFS version is easier to check by eye, because each band is one pair. Tip: long formulas are easier to read on several lines. Click in the formula bar and press Alt+Enter on Windows (Control+Option+Return on a Mac) to start a new line before each test.
Why the order of tests matters#
Both functions stop at the first TRUE test. Look what happens if the lowest band comes first:
=IF(B2>=70,"C",IF(B2>=80,"B",IF(B2>=90,"A","F")))Ana's 94 passes B2>=70, so she gets C, and Excel never reaches the A test. The fix is the same in both functions: test the highest band first, or use exact ranges like AND(B2>=80,B2<90).
When to use nested IF#
Use nested IF when compatibility matters or when there are only two or three results. It is the better choice when:
- The file must work in Excel 2016 or older without a Microsoft 365 subscription. IFS shows #NAME? there.
- You only need two or three results.
=IF(B2>=60,"Pass","Fail")needs no nesting at all. - Each branch does something different, such as a calculation in one branch and a further check in another.
- A test asks for IF by name. Many Excel tests still do.
When to use IFS#
Use IFS when you have three or more results and everyone has Excel 2019 or later. It is the better choice when:
- You have several bands, such as grades, commission tiers or shipping zones.
- Other people will edit the formula. Adding a new band means adding one pair, not another layer of brackets.
- You want to read the logic in order, left to right, like a list of rules.
Here is a commission rate that pays 8% on sales of 100,000 or more, 5% on 60,000 or more, 3% on 30,000 or more, and nothing below that:
=IFS(B2>=100000,0.08,B2>=60000,0.05,B2>=30000,0.03,TRUE,0)What to use instead of a long IF or IFS#
When the list of bands grows past four or five, or the thresholds change often, put them in a small table and look them up. With the band starts 0, 70, 80 and 90 in E2:E5 and the grades F, C, B and A in F2:F5:
=XLOOKUP(B2,$E$2:$E$5,$F$2:$F$5,,-1)
=VLOOKUP(B2,$E$2:$F$5,2,TRUE)Both return the grade for the largest band start that is less than or equal to the score. XLOOKUP's -1 means "exact match or next smaller" and needs Excel 2021, Excel 2024 or Microsoft 365. VLOOKUP with TRUE works everywhere but needs the band starts sorted from smallest to largest. To change a threshold, you edit one cell instead of a formula.
For exact matches, such as turning the codes P, S and D into words, SWITCH is shorter than either IF or IFS:
=SWITCH(D2,"P","Pending","S","Shipped","D","Delivered","Check code")The last value, "Check code", is SWITCH's default when no code matches. SWITCH also needs Excel 2019 or later.
Common mistakes with nested IF and IFS#
These slips cause most wrong labels:
- Testing the lowest band first. The first TRUE test wins, so
B2>=70beforeB2>=90gives a 94 a C. - Forgetting the TRUE pair in IFS. Without it, a score of 59 matches nothing and returns #N/A.
- Missing or extra brackets in nested IF. Count them: three IFs need three closing brackets at the end.
- Typing numbers with commas or symbols. Write
100000, not100,000or$100,000. Inside a formula, the comma splits arguments. - Putting quotes around numbers.
"90"is text. Compare with90so Excel compares numbers. - Using IFS in a file for older Excel. Check the version first, or use nested IF.
If your IF formula wraps a calculation that can fail, such as a division or a lookup, our guide to IFERROR vs IFNA shows how to handle the error without hiding real mistakes. For a deeper look at each function, see how to write a nested IF in Excel and the IFS function explained.
Our recommendation#
Use IFS for three or more results when everyone has Excel 2019 or later: it is easier to read, easier to extend and harder to break with a missing bracket. Always end it with TRUE and a default value. Use nested IF for two or three results, for files that must work in older versions, and whenever a test asks for IF. Once you go past four or five bands, switch to a lookup table.
In short: IFS for readable multi-band formulas, nested IF for compatibility, a lookup table for long lists.
Practise it#
Try the IFS exercise on this page: Cara's 67 matches none of the bands, so the TRUE pair has to catch it. Then practise nested IF and IFS in a live spreadsheet, including fixing a formula that tests the bands in the wrong order.
Try it yourself
This is a live spreadsheet. Type the formula in the green cell and press Enter.
In C4, grade Cara's score in B4 with IFS: A for 90 or more, B for 80 or more, C for 70 or more, and F for anything else. Use TRUE as the last test.
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Grade | |||
| 2 | ||||
| 3 | ||||
| 4 | ||||
| 5 | ||||
| 6 | ||||
| 7 | ||||
| 8 | ||||
| 9 | ||||
| 10 |
Tip: Write the pairs from the highest band down: test, then grade. The last pair is TRUE and "F".
Practise this in a lesson
Frequently asked questions
Is IFS better than nested IF?
For three or more results, IFS is usually easier to read and edit because it has no nested brackets. Nested IF is the better choice when the file must open in Excel 2016 or older.
How do I add an "else" to IFS?
Make TRUE the last test, followed by the value you want, for example TRUE,"F". TRUE always passes, so it catches every case the earlier tests missed.
Why does my IFS formula return #N/A?
None of the tests was TRUE, and IFS has no default result. Add TRUE and a value as the final pair.
How many IFs can you nest in Excel?
Excel allows up to 64 nested IF functions, and IFS accepts up to 127 test and value pairs. If you need more than a few, a lookup table is easier to read and change.
Does IFS work in Excel 2016?
Only with a Microsoft 365 subscription. The one-time-purchase version of Excel 2016 doesn't have IFS, so it shows #NAME?. Excel 2019 and later include it.