What is the IFS function?
=IFS(logical_test1, value_if_true1, [logical_test2, value_if_true2], ...)IFS tests several conditions in order from the top and returns the value of the first condition that is true. It replaces nested IFs, such as for grading by score band, with one function.
If no condition is true you get #N/A, so it is common to put TRUE as the last condition to set a value for "everything else". You can use up to 127 conditions.
IFS is available in Office 2019 and later and Microsoft 365.
Arguments
- logical_test1, value_if_true1
- The first condition to test, and the value to return when it is true.
- logical_test2, value_if_true2, ...
- The next condition and value. Tested only when the earlier conditions are false.
- TRUE, default
- With TRUE as the last condition, this value is returned when all the conditions above are false.
IFS examples
Example 1. Grade by score
=IFS(B2>=90, "A", B2>=80, "B", B2>=70, "C", TRUE, "F")Liam's Reading score of 85 is not 90 or more but is 80 or more, so "B". This is how the sheet looks when the page opens.
Example 2. Leaving out the final TRUE
=IFS(B5>=90, "A", B5>=80, "B", B5>=70, "C")Olivia's Reading score of 58 meets none of the conditions, so you get #N/A. Clear the "If none" box above to check.
Example 3. Text conditions
=IFS(A2="Seoul", "HQ", A2="Busan", "South branch", TRUE, "Other")Conditions can test text as well as numbers.
Common mistakes
Conditions in the wrong order
=IFS(B2>=70,"C", B2>=80,"B", B2>=90,"A") stops at the first condition B2>=70 even for 95 points and gives "C". Write the largest threshold first.
Forgetting the final TRUE
If a value meets none of the conditions, you get #N/A. Add TRUE and a default at the end.
Opening in Excel 2016
IFS exists in Office 2019 and later. If you share files with earlier versions, use nested IFs.
FAQ
- How is it different from nested IFs?
- The result is the same, but the parentheses don't pile up, so it is easier to read and edit.
- How many conditions?
- Up to 127. With very many, the order is hard to manage, so consider a band table with an approximate VLOOKUP.
- Pick only on an exact value?
- Use = in the condition. If each exact value has its own result, there is also SWITCH.