Excel function

IFSfunction

Tests several conditions from the top and returns the value of the first one that is true.

Excel 2019+
=IFS(B2>=90, "A", B2>=80, "B", B2>=70, "C", TRUE, "F")
A
B
C
D
E
1
2
3
4
5
6
7

Click a cell in the table to change Cell to test. Clear the "If none" box and rows under 70 points show #N/A. Try breaking it on purpose to see the errors.

Result

B

Cell to test
B2You can also click a cell in the table

The score cell to grade. Click other cells in the sheet.

Threshold 1

The first threshold. If the cell is this value or more, value1 is returned.

value1

The value returned when threshold 1 is met.

Threshold 2

The second threshold. If the cell is this value or more, value2 is returned.

value2

The value returned when threshold 2 is met.

Threshold 3

The third threshold. If the cell is this value or more, value3 is returned.

value3

The value returned when threshold 3 is met.

If none

The value returned when every condition above is false. In the formula it goes last, with TRUE. Leave it empty and you may get #N/A.

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

  1. 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.

  2. 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.

  3. Example 3. Text conditions

    =IFS(A2="Seoul", "HQ", A2="Busan", "South branch", TRUE, "Other")

    Conditions can test text as well as numbers.

Common mistakes

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.