The Excel IFS Function: Cleaner Than Nested IFs
By ExcelReady TeamUpdated 6 min read
The short answer
The Excel IFS function checks a list of conditions in order and returns the result paired with the first TRUE one: =IFS(test1, value1, test2, value2, ...). It replaces nested IFs without the brackets. IFS has no "otherwise" result, so end with TRUE and a fallback value. It needs Excel 2019 or later.
Key takeaways
- IFS takes pairs: a test, then the value to return when that test is TRUE.
- Excel stops at the first TRUE test, so order the tests from the highest band down or the lowest band up.
- If no test is TRUE, IFS returns #N/A; a final TRUE pair works as the 'otherwise' result.
- IFS needs Excel 2019, Excel 2021 or Microsoft 365; older versions show #NAME?.
On this page+
The Excel IFS function does the job of a nested IF without the nesting. You give it a list of tests and results, and it returns the result for the first test that is TRUE. It's ideal for grades, price bands and status labels. This guide covers the syntax, the one trick every IFS formula needs, and which Excel versions support it.
How does the Excel IFS function work?#
IFS checks each test in order and returns the value paired with the first TRUE test. The syntax is:
=IFS(logical_test1, value_if_true1, [logical_test2, value_if_true2], ...)Arguments come in pairs: a test, then the value to show when that test is TRUE. You can have up to 127 pairs. As soon as one test is TRUE, Excel stops and ignores the rest.
Compare the same grade formula written both ways:
=IF(B2>=90,"A",IF(B2>=80,"B",IF(B2>=70,"C","F")))
=IFS(B2>=90,"A",B2>=80,"B",B2>=70,"C",TRUE,"F")Both return the same grades. The IFS version is one flat list, with one pair of brackets, so it's easier to read and harder to break. For the full trade-off, see the nested IF vs IFS comparison.
Why end IFS with TRUE?#
IFS has no "otherwise" result. If none of the tests is TRUE, it returns #N/A. The fix is a last pair whose test
is simply TRUE:
=IFS(B2>=90,"A",B2>=80,"B",B2>=70,"C",TRUE,"F")TRUE always passes, so any score that reaches it gets "F". Type TRUE without quotes: it is a logical value, not
text. You will see this pattern in almost every IFS formula, and it's a common job-test question.
| Student | Score | Without the TRUE pair | With TRUE,"F" |
|---|---|---|---|
| Ana | 94 | A | A |
| Dev | 78 | C | C |
| Cara | 67 | #N/A | F |
| Fay | 55 | #N/A | F |
How to write an IFS formula for price bands#
Write the pairs in order, from the highest band down with >=, or from the lowest band up with <=. Here is a
shipping table that starts with the lightest parcels:
=IFS(B2<=1,4.5,B2<=5,7.95,B2<=20,12,TRUE,"Quote")| Order | Weight (kg) | Shipping | Why |
|---|---|---|---|
| SO-2201 | 0.8 | 4.5 | Passes the first test |
| SO-2202 | 3.2 | 7.95 | Fails <=1, passes <=5 |
| SO-2203 | 12 | 12 | Passes <=20 |
| SO-2204 | 25 | Quote | Fails all three, so TRUE catches it |
| SO-2205 | 5 | 7.95 | Exactly 5, and <= includes it |
To build it yourself:
- Click C2 and type
=IFS(. - Type the first pair: the test
B2<=1, a comma, the result4.5, a comma. - Add the next pairs the same way:
B2<=5,7.95,thenB2<=20,12,. - Finish with
TRUE,"Quote")and press Enter. - Fill down with Ctrl+D (Windows) or ⌘D (Mac).
Order still matters. If B2<=20 came first, every parcel up to 20 kg would cost 12, because Excel stops at the first
TRUE test. IFS is cleaner than nested IF, but it doesn't fix tests in the wrong order.
This column mixes numbers and text. That's fine for reading, but remember that SUM skips text: a total of column C
leaves out the "Quote" rows rather than warning you about them. For more on <=, >= and the
other signs, read the guide to Excel comparison operators.
Can IFS return a calculation?#
Yes. A value can be a number, text, a cell reference or a calculation. This one works out commission in one step by multiplying the sales by the rate IFS picks:
=B2*IFS(B2>=100000,0.08,B2>=60000,0.05,B2>=30000,0.03,TRUE,0)For sales of 61000, the rate is 0.05, so the result is 3050. Keep the TRUE,0 pair: without it, sales under 30000
give #N/A, and #N/A times anything is still #N/A.
You can also use AND or OR as a test inside IFS, for example
=IFS(AND(C2>=50000,D2>=4.5),"Top",C2>=50000,"Good",TRUE,"Coach"). See
AND, OR and NOT in Excel for how those tests work.
Should you use IFS or SWITCH?#
Use IFS when the tests are ranges or different conditions, and SWITCH when you match one value against exact options. Both need Excel 2019 or later.
| IFS | SWITCH | |
|---|---|---|
| Best for | Bands and ranges: >=90, <=5 | Exact codes: "P", "S", "D" |
| Each pair | A test, then a result | A value to match, then a result |
| "Otherwise" result | Needs a final TRUE, pair | A single value at the end |
| No match and no fallback | #N/A | #N/A |
So grades and price bands suit IFS, and turning status codes into labels suits SWITCH. Read the SWITCH function guide for examples.
Which versions of Excel have IFS?#
IFS is available in Excel 2019, Excel 2021, Excel 2024, Microsoft 365 (Windows and Mac) and Excel for the web. Excel 2016 bought as a one-time purchase, and earlier versions, don't have it.
If you open a file that uses IFS in an older version, the cell shows #NAME? after it recalculates, and the formula
appears with an _xlfn. prefix. If your file goes to people on older Excel, or a job test runs on an older install,
use a nested IF instead. It works everywhere.
What are the common IFS mistakes?#
These cause most IFS problems:
| Mistake | What you see | Fix |
|---|---|---|
| No TRUE pair at the end | #N/A for some rows | Add TRUE, and a fallback |
A lone fallback: ...,B2>=70,"C","F") | Excel won't accept the formula | Write TRUE,"F", not just "F" |
| Tests in the wrong order | Values land in the wrong band | Highest first with >=, or lowest first with <= |
| Older Excel version | #NAME? | Use nested IF |
The second row catches people who know SWITCH, which does accept a lone default value at the end. IFS doesn't: every argument must be part of a pair.
Also be careful about what IFS can't catch. If B2 holds an error, such as #DIV/0!, IFS passes that error on. Fix the source if you can, or handle it deliberately with IFERROR, used the right way.
For every argument in one place, see the IFS function guide.
Practise it#
Try the shipping exercise on this page, then practise IFS and nested IF in a live spreadsheet. The lesson builds grades with both functions, shows the #N/A you get without the TRUE pair, and finishes with a commission formula.
Try it yourself
This is a live spreadsheet. Type the formula in the green cell and press Enter.
Shipping costs 4.5 for parcels up to 1 kg, 7.95 up to 5 kg and 12 up to 20 kg. Anything heavier needs a quote. In C2, use IFS on the weight in B2 to return the cost, testing the lightest band first with <=. End with a TRUE,"Quote" pair.
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Shipping | |||
| 2 | ||||
| 3 | ||||
| 4 | ||||
| 5 | ||||
| 6 | ||||
| 7 | ||||
| 8 | ||||
| 9 | ||||
| 10 |
Tip: Write the pairs from the lightest band up: B2<=1 with 4.5, then B2<=5 with 7.95, and so on. Numbers need no quotes.
Practise this in a lesson
Frequently asked questions
What is the difference between IF and IFS in Excel?
IF tests one condition and returns one of two results. IFS tests several conditions in order and returns the result for the first TRUE one, so it replaces a chain of nested IFs.
How do I add an 'else' to IFS?
Add TRUE as the last test, followed by the fallback value, like ...,TRUE,"F"). TRUE always passes, so it catches every value that failed the earlier tests.
Why does IFS return #N/A?
None of the tests was TRUE for that row, and IFS has no built-in default. Add a final TRUE pair with a fallback value.
Which Excel versions have the IFS function?
IFS is in Excel 2019, Excel 2021, Excel 2024, Microsoft 365 and Excel for the web. Excel 2016 bought outright and earlier versions don't have it and show #NAME?.
Can IFS use AND or OR?
Yes. Any test can be an AND or OR, like =IFS(AND(B2>=50000,C2>=4.5),"Top",B2>=50000,"Good",TRUE,"Coach").