IFS function
Checks several conditions in order and returns the value for the first one that is TRUE. A cleaner alternative to nested IF formulas.
Available in Microsoft 365, Excel 2019 and later, Excel for the web
Excel 2019 and laterWorks in Google Sheets
Syntax
IFS(logical_test1, value_if_true1, [logical_test2, value_if_true2], ...)| Argument | What it means | |
|---|---|---|
logical_test1 | Required | The first condition to check. |
value_if_true1 | Required | The result if logical_test1 is TRUE. |
logical_test2, value_if_true2, ... | Optional | More pairs of condition and result, up to 127 pairs. They are checked from left to right. |
Returns: The value paired with the first TRUE condition, or #N/A if none is TRUE.
How IFS works
IFS does the job of a stack of nested IF functions in a flat, readable list. You write pairs: a condition, then the value to return if that condition is TRUE. Excel walks through the pairs from left to right and returns the value of the first condition that holds; everything after it is ignored.
Because the first match wins, order your conditions carefully. For bands such as grades or discount tiers, start with the highest threshold (>=90, then >=75, ...) — if you started with >=60, a score of 95 would stop there.
Unlike IF, IFS has no built-in "otherwise" value. If none of the conditions is TRUE you get #N/A. The standard trick is to finish with the pair TRUE, "something": the condition TRUE always holds, so it acts as the catch-all default.
Examples
1Grade bands without nesting
| A | B | C | |
|---|---|---|---|
| 1 | Student | Score | |
| 2 | Nadia | 82 | B |
| 3 | Pablo | 58 | |
| 4 | Quinn | 93 |
Result: B
82 fails the first test (≥90) and passes the second (≥75), so IFS returns B. Pablo's 58 fails the first three tests and falls to the TRUE catch-all: F.
2Shipping cost by parcel weight
| A | B | C | |
|---|---|---|---|
| 1 | Order | Weight (kg) | |
| 2 | SO-881 | 3.2 | 7.9 |
| 3 | SO-882 | 0.6 | |
| 4 | SO-883 | 24 |
Result: 7.9
A 3.2 kg parcel is over 1 kg but within 5 kg, so the cost is 7.90 (shown as 7.9 in General format). SO-883 at 24 kg reaches the last pair and shows Freight quote.
3What happens without a default
| A | B | C | |
|---|---|---|---|
| 1 | Student | Score | |
| 2 | Pablo | 55 | #N/A |
Result: #N/A
55 matches neither condition and there is no TRUE pair at the end, so IFS returns #N/A. Add TRUE, "Other" to avoid this.
Common errors and how to fix them
| Error | Why it happens | Fix |
|---|---|---|
#N/A | No condition was TRUE. | End the list with TRUE, value as a default. |
Error message when entering | A condition is missing its result value (an odd number of arguments). | Check that every test has a value right after it. |
#NAME? | The workbook is opened in Excel 2016 or earlier, which does not have IFS. | Use nested IF for files that must work in older versions. |
Tips
- Put each pair on its own line with Alt+Enter (Mac: Ctrl+Option+Return) in the formula bar — long IFS formulas become much easier to check.
- When you are comparing one cell to exact values (
B2="N",B2="S", ...) SWITCH is shorter, because the cell is written only once. - For more than five or six bands, a lookup table with XLOOKUP (match_mode -1) is easier to update than a formula.
Questions
Is IFS better than nested IF?
It is easier to read and edit, and it is evaluated the same way: first TRUE wins. The only downside is that it needs Excel 2019 or later, so shared files for older versions should stick with IF.
How do I set an "else" value in IFS?
Add TRUE as the last condition followed by the default value, e.g. ..., TRUE, "Other").
Google Sheets
IFS also exists in Google Sheets and works the same way for everyday use, so the examples above work there too.
IFS in other languages
In a non-English version of Excel the function has a local name. Excel translates formulas automatically when a file is opened in another language.
| Language | Function name |
|---|---|
| Danish | HVISER |
| Dutch | ALS.VOORWAARDEN |
| Finnish | JOS.JOUKKO |
| French | SI.CONDITIONS |
| German | WENNS |
| Hungarian | HAELSŐIGAZ |
| Italian | PIÙ.SE |
| Norwegian (Bokmål) | HVIS.SETT |
| Polish | WARUNKI |
| Portuguese (Brazil) | SES |
| Portuguese (Portugal) | SE.S |
| Russian | ЕСЛИМН |
| Spanish | SI.CONJUNTO |
| Turkish | ÇOKEĞER |
Recipes that use IFS
- How to check if a cell contains a word in Excel
- How to use IF with multiple conditions in Excel
- How to use nested IF and IFS in Excel