IFS in Excel: Five Rules That Stop the Wrong Answer

IFS in Excel: Five Rules That Stop the Wrong Answer
IFS checks several conditions in order and returns the result of the first one that is true. It replaces formulas with IF inside IF, which work fine and become unreadable by the third layer. The function is simple; what goes wrong is the logic around it, because IFS does not tell you when your conditions are in the wrong order. It just returns a number that looks reasonable. These five rules cover almost every case where an IFS formula gives an answer nobody expected.
What IFS actually does
It takes pairs of arguments: a condition, then the value to return if that condition is true. Up to 127 pairs. Excel walks them left to right and stops at the first true one. That single sentence explains every ordering problem below, and it is the reason the order of your conditions is part of the logic, not a formatting choice.
Rule 1: the first true condition wins
Take commission tiers. Up to 1,000 earns 2%, up to 5,000 earns 4%, above that 5%. Written correctly: =IFS(C2<=1000;C2*2%;C2<=5000;C2*4%;TRUE;C2*5%). Now swap the first two pairs and every small amount lands in the 4% tier, because 800 is also less than 5,000. The formula shows no error. It just pays the wrong commission, which is the worst kind of bug because payroll believes it.
If you invoice clients or run a small shop, the ready-made Excel sales invoice template and bookkeeping ledger saves building the file from scratch: Excel invoice and bookkeeping template - a product in our store.
Rule 2: always end with a TRUE pair
Without a final catch-all, a value that matches nothing returns #N/A. That is the most common surprise with IFS, and it looks identical to a lookup that found nothing. Add TRUE as the last condition and the default result as its value. In a report that other people read, a default of "check" or "other" is better than an error, and better than a silent zero.
Rule 3: write narrow conditions before wide ones
Every condition should be stricter than the one below it. If you find yourself writing a wide condition early, you have the order wrong. A practical check: read the pairs aloud from top to bottom. If a later pair can never be reached, the order is broken, even though Excel will not complain.
Rule 4: test the boundaries, not the middle
The middle values almost always pass. The bugs live at exactly 1,000, at exactly 5,000, and at the first row where no condition applies. Build a small test block with the minimum, the boundary, the boundary plus one, and the maximum, and compare what IFS returns with what the business rule says. This takes two minutes and catches the error before a customer does.
Rule 5: move stable tiers into a table
If the limits change every year, numbers written inside the formula mean editing the formula every year. Put the limits and percentages in a two-column table and use an approximate lookup: =VLOOKUP(C2;Limits;2;TRUE). Then the formula never changes and the table does. The same idea works with XLOOKUP and its match mode set to the next smaller item.
A worked example
Four amounts: 400, 1,000, 3,200 and 9,000, with the tiers above. Correct results: 8, 20, 128 and 450. Now test 1,000 exactly: with <=1000 it earns 2% and pays 20. If someone wrote <1000 instead, it falls to the 4% tier and pays 40. Both formulas run, both look right, and only the boundary test shows the difference. That is why rule 4 exists.
Common mistakes
| Mistake | What you see | Fix |
|---|---|---|
| No final TRUE pair | #N/A on some rows | Add a default pair |
| Wide condition first | Wrong but plausible numbers | Reorder, narrow to wide |
| Amounts stored as text | Comparisons fail silently | Check with ISNUMBER first |
| Mixing AND and OR without brackets | One part of the condition is ignored | Bracket each group |
IFS or nested IF?
For two outcomes, IF is shorter and clearer. For three or more exclusive tiers, IFS reads like a list and is easier to audit. For a lookup against a table of limits, an approximate VLOOKUP or XLOOKUP beats both, because the numbers live in one place and the formula stays short.
Versions and sharing
IFS needs Excel 2019 or Microsoft 365. In older versions the name does not exist and you get #NAME?, where nested IF is the fallback: =IF(C2<=1000;C2*2%;IF(C2<=5000;C2*4%;C2*5%)). If the workbook is shared, check which version the other people use before choosing, and keep the same order logic either way.
Test it in two minutes
Copy the formula into a blank sheet, put four test values beside it and check each result against the rule in writing. If one of them surprises you, the formula is wrong, not the test.
Read next
When an IFS formula returns #N/A because nothing matched, the cause and the fix are the same as in lookups: see IFERROR in Excel: Catch #N/A, #DIV/0! and #VALUE! Before Anyone Sees Them.
When IFS becomes hard to read
Six or seven tiers and even IFS turns into a wall of semicolons. At that point the formula is not the right shape for the job: move the limits to a table, as in rule 5, and let a lookup do the matching. A useful test is whether a colleague can tell you what a specific amount earns without running the formula. If they cannot, the formula is too long for the job.
IFS that returns text
The result does not have to be a number. A collections sheet can mark each invoice as overdue, due soon or on time: =IFS(E2<0;"overdue";E2<=7;"due soon";TRUE;"on time"). Text results can then be counted with COUNTIF and filtered like any other column. The same rule applies: the narrowest condition first, and the default last, or a paid invoice ends up labelled overdue.
What about SWITCH?
SWITCH compares one value against a list of exact matches and returns the matching result. Use it when you are testing equality, such as a status code turning into a label, and use IFS when you are testing ranges or conditions. Choosing between them is mostly about which one reads like the sentence you would say out loud.
One note on recalculation
IFS itself is fast. What slows a sheet down is hundreds of IFS formulas each referencing whole columns. Keep the references to the rows you actually have, and if the file is shared with people on older Excel, remember that every IFS becomes #NAME? for them.
IFS inside a table column
In a formatted table, write the formula once and it fills the whole column, including rows added tomorrow. Point the references at the table's own columns so the formula reads as a rule rather than as cell coordinates. This is also the version that survives someone inserting a row above, which is where hand-written ranges quietly break.
One question people ask
How do you know a condition can never be reached? Put a deliberately extreme value in a test cell and walk down the pairs by hand. If a later pair returns the same result as the one above it for every value you try, it is dead code and the order needs fixing.
Test the first condition with a single row before you fill the column down.
Official source
Arguments and examples: IFS function. For the classic version: IF function.
Last updated: 5 December 2026
Comments
Post a Comment