The IFS function
IFS replaces a chain of nested IFs. You list test, result, test, result, and it returns the result for the *first* test that's TRUE, then stops.
Order matters: put the strictest test first. There's no built-in "otherwise", so finish with TRUE and a default result.
=IFS(logical_test1, value_if_true1, [logical_test2, value_if_true2], ...)
Arguments
- logical_test1
- The first condition to check.
- value_if_true1
- The result if that condition is TRUE.
- logical_test2, value_if_true2, ...optional
- More condition and result pairs, checked in order.
Try it
=IFS(B2>=70,"Distinction",B2>=55,"Merit",B2>=40,"Pass",TRUE,"Fail") in C2. Amira's 82 passes the first test, B2>=70, so IFS returns Distinction and doesn't check the rest.
C2
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Student | Mark | Grade | |
| 2 | Amira | 82 | Distinction | |
| 3 | Ben | 67 | ||
| 4 | Chen | 54 | ||
| 5 | Dara | 38 | ||
| 6 | ||||
| 7 |
Edit the formula in C2, or change the data, and press Enter.
More examples
| Formula | Result | What it does |
|---|---|---|
| =IFS(B3>=70,"Distinction",B3>=55,"Merit",B3>=40,"Pass",TRUE,"Fail") | Merit | 67 fails the first test but passes the second. |
| =IFS(B4>=70,"Distinction",B4>=55,"Merit",B4>=40,"Pass",TRUE,"Fail") | Pass | 54 is just short of a Merit. |
| =IFS(B5>=70,"Distinction",B5>=55,"Merit",B5>=40,"Pass",TRUE,"Fail") | Fail | No test passes until the final TRUE, the catch-all. |
| =IFS(B5>=70,"Distinction",B5>=40,"Pass") | #N/A | Without a TRUE pair at the end, a mark that fails every test gives #N/A. |
Tips
- IFS is in Excel 2019, Excel 2021 and Microsoft 365. Excel 2016 and earlier don't have it; use nested IF there.
- When you're comparing one cell against a list of exact values, SWITCH is shorter.
- Put the grade boundaries in cells, such as
B2>=$F$1, so they're easy to change.
Common mistakes
- Everyone gets the same grade.The tests are in the wrong order. With
B2>=40first, an 82 stops there and gets "Pass". Start with the highest boundary. - #N/A appears for some rows.No test was TRUE. Add
TRUE,"Fail"(or another default) as the last pair. - Excel says there are too few arguments.Every test needs a result after it. Count the pairs.
Practise IFS with instant feedback
Type real formulas into a working spreadsheet and get told straight away whether they work.