IFS function in Excel
IFS checks several conditions in order and returns the result for the first one that is true.
IFS replaces a chain of IFs nested inside each other. Where a nested IF ends in a tail of closing brackets, IFS is a flat list: condition, result, condition, result. It is available in Excel 2019, Excel 2021 and Microsoft 365.
Syntax
=IFS(logical_test1, value_if_true1, [logical_test2, value_if_true2], ...)| Argument | What it is |
|---|---|
logical_test1 | The first condition to check. |
value_if_true1 | What to return if the first condition is true. |
logical_test2, value_if_true2, ... | More pairs of condition and result, checked in order. |
Examples
Each result below is what Excel itself showed for the formula on the sample sheet.
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Name | Class | Maths | Science | English |
| 2 | Asha | 8A | 78 | 85 | 91 |
| 3 | Ravi | 8B | 45 | 52 | 60 |
| 4 | Meena | 8A | 92 | 88 | 79 |
| 5 | Kabir | 8B | 33 | 41 | 38 |
| 6 | Tara | 8A | 67 | 72 | |
| 7 | Joy | 8B | 88 | 90 | 84 |
| 8 | Neha | 8A | 54 | 61 | 58 |
| 9 | Imran | 8B | 78 | 73 | 69 |
=IFS(C2>=90,"A",C2>=75,"B",C2>=50,"C",C2>=33,"D",TRUE,"Fail")Result: BAsha has 78. The first condition fails, the second is true, so the result is B and the rest are not checked.
=IFS(C5>=90,"A",C5>=75,"B",C5>=50,"C",C5>=33,"D",TRUE,"Fail")Result: DKabir has 33: the first three conditions fail and the fourth is true, D.
=IFS(C3>=90,"A",C3>=75,"B",C3>=50,"C")Result: #N/ARavi has 45 and no condition is true. With no catch-all at the end, the result is #N/A.
=IFS(E2>C2,"English",E2<C2,"Maths",TRUE,"Same")Result: EnglishThe conditions need not test the same thing. Asha's English mark is higher than her Maths mark.
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Code | Item | Category | Price | Stock |
| 2 | A101 | Basmati Rice 5 kg | Grocery | 650 | 40 |
| 3 | A102 | Toor Dal 1 kg | Grocery | 160 | 75 |
| 4 | B201 | Notebook | Stationery | 60 | 300 |
| 5 | B202 | Ball Pen | Stationery | 10 | 0 |
| 6 | C301 | LED Bulb | Electronics | 110 | 200 |
| 7 | C302 | Power Bank | Electronics | 1299 | 18 |
| 8 | D401 | Steel Bottle | Home | 450 | 55 |
=IFS(E5=0,"Sold out",E5<50,"Low",TRUE,"In stock")Result: Sold outStock status for the Ball Pen, which has a stock of 0.
How it works
IFS reads its pairs from left to right. As soon as a condition is true, it returns the result that follows and stops. Later pairs are never looked at.
That makes the order important. With rising boundaries, test the highest first. If the first example started with C2>=33,"D", every student who passed would get a D, because that condition is true for all of them and nothing after it would be reached.
The catch-all at the end
A nested IF has a final "otherwise". IFS does not. If no condition is true, the result is the error #N/A, as the third example shows. The usual cure is to make the last condition the word TRUE, which is always true, followed by the default result:
=IFS(C2>=90,"A", C2>=75,"B", TRUE,"Other")
Always add it, unless an error for an unexpected value is what you want.
IFS compared with nested IF
The same grading written both ways:
- Nested:
=IF(C2>=90,"A",IF(C2>=75,"B",IF(C2>=50,"C",IF(C2>=33,"D","Fail")))) - IFS:
=IFS(C2>=90,"A",C2>=75,"B",C2>=50,"C",C2>=33,"D",TRUE,"Fail")
IFS has no brackets to count. Its weakness is compatibility: Excel 2016 and earlier show #NAME?. If the file must open on old versions, stay with nested IF.
When a table is better
Five or six boundaries typed into a formula are hard to change, and they are hidden from the person reading the sheet. If the bands may change, such as tax slabs or grade boundaries set by a board, keep them in a small table and look the answer up with VLOOKUP or XLOOKUP in approximate mode. The formula then never needs editing.
Common mistakes
- Conditions in the wrong order, so that an early, wide condition catches everything.
- No final
TRUE, giving#N/Afor values that fit no band. - An odd number of arguments. Every condition needs its result. Excel reports that you have entered too few arguments.
- Overlapping conditions written as ranges. You do not need
AND(C2>=75,C2<90). Because IFS stops at the first true condition, by the time it testsC2>=75it already knows the mark is below 90.
In Google Sheets
Google Sheets has IFS with the same behaviour.
Related functions
Every result on this page was calculated in Microsoft Excel (version 16.0, build 20326) on 12 November 2026, not typed by hand.
This is an independent help site. It is not connected with or approved by Microsoft. Excel and Microsoft 365 are trademarks of Microsoft Corporation, named here only to say which program a formula is for. The people and figures in the sample sheets are made up.