Logical function

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], ...)
ArgumentWhat it means
logical_test1RequiredThe first condition to check.
value_if_true1RequiredThe result if logical_test1 is TRUE.
logical_test2, value_if_true2, ...OptionalMore 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

C2fx=IFS(B2>=90, "A", B2>=75, "B", B2>=60, "C", TRUE, "F")
ABC
1StudentScore
2Nadia82B
3Pablo58
4Quinn93

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

C2fx=IFS(B2<=1, 4.5, B2<=5, 7.9, B2<=20, 15, TRUE, "Freight quote")
ABC
1OrderWeight (kg)
2SO-8813.27.9
3SO-8820.6
4SO-88324

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

C2fx=IFS(B2>=90, "A", B2>=75, "B")
ABC
1StudentScore
2Pablo55#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.

⬇Practice workbookExamples with live formulas + practice sheets · .xlsx · 16 KB

Common errors and how to fix them

ErrorWhy it happensFix
#N/ANo condition was TRUE.End the list with TRUE, value as a default.
Error message when enteringA 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.

LanguageFunction name
DanishHVISER
DutchALS.VOORWAARDEN
FinnishJOS.JOUKKO
FrenchSI.CONDITIONS
GermanWENNS
HungarianHAELSŐIGAZ
ItalianPIÙ.SE
Norwegian (Bokmål)HVIS.SETT
PolishWARUNKI
Portuguese (Brazil)SES
Portuguese (Portugal)SE.S
RussianЕСЛИМН
SpanishSI.CONJUNTO
TurkishÇOKEĞER

Recipes that use IFS