Excel’s IFS function checks conditions in order and returns the result paired with the first condition that is TRUE. For example, with a student’s score in B2, =IFS(B2>=90,"A",B2>=80,"B",B2>=70,"C",B2>=60,"D",TRUE,"F") assigns a letter grade; a score of 84 returns B. IFS is useful when a formula needs several outcomes without a long chain of nested IF functions.
What the IFS function does
IFS is a logical function for mapping multiple tests to corresponding results. It evaluates the tests from left to right, then returns the value paired with the first test that evaluates to TRUE. If none of the tests is true and you have not supplied a final catch-all test, the formula returns the #N/A error.
Each test and its result form a pair: a condition such as “the score is at least 80,” followed by what Excel should return if that condition is met. You can use numbers, text, cell references, or calculations as results. Text results must be enclosed in straight double quotation marks; a cell reference or numeric result does not need quotation marks.
IFS is available in Excel 2019 and later, including Microsoft 365. If a workbook will be opened in an older Excel version, check compatibility: an older installation may not recognize IFS and can display a function-name error.
Example: assign grades from a score
Suppose scores are in B2:B30, with one score per student. The formula below handles the highest grade first, then moves through lower thresholds. If B2 contains 84, Excel returns B. If it contains 59, the final TRUE condition returns F.
With a student’s numeric score in B2, enter this in the grade cell:
=IFS(B2>=90,"A",B2>=80,"B",B2>=70,"C",B2>=60,"D",TRUE,"F")
TRUE at the end acts as a default: because TRUE is always true, Excel uses F whenever none of the score thresholds matched. This is often safer than spelling out a final condition such as “score is below 60.” It also means an unexpected value, such as a negative score, gets F rather than an error. If negative scores or scores above 100 should be treated as invalid, add a validation rule or an earlier condition that returns an “Invalid score” label.
To apply the same grading logic to additional rows, copy the formula down. The relative reference B2 adjusts to B3, B4, and so on. Before using the results for reporting, check that the score cells contain numbers rather than numbers stored as text.
Example: classify values into ranges
IFS works well for categories based on thresholds, including age bands, stock levels, service ratings, and response times. The order matters because the first true test wins. For ascending age groups, test the lower cutoffs in ascending order; once a cutoff is met, later conditions are not the result Excel returns.
With a person’s age in A2, this formula labels ages below 13 as Child, ages 13 through 19 as Teen, ages 20 through 64 as Adult, and ages 65 or above as Senior. If A2 is 17, the result is Teen.
=IFS(A2<13,"Child",A2<20,"Teen",A2<65,"Adult",TRUE,"Senior")
For an inventory example, assume the quantity available is in B2. A zero quantity is Out of stock, one to five is Reorder, six to 20 is Low, and more than 20 is In stock. With B2 equal to 4, the result is Reorder.
With the quantity on hand in B2, enter:
=IFS(B2=0,"Out of stock",B2<=5,"Reorder",B2<=20,"Low",TRUE,"In stock")
Notice that the formula checks for zero before the broader “less than or equal to five” test. If that first test were removed, zero would be classified as Reorder instead. Consider boundary values whenever you build ranges: test the value just below, exactly at, and just above every cutoff. This catches gaps and unintended overlaps before the formula is copied through a large table.
Example: combine multiple conditions
A condition does not have to compare only one cell. Use AND when all listed requirements must be true, or OR when at least one requirement is enough. These functions can be used inside an IFS test.
Suppose a learner’s score is in B2 and their attendance status, written as Yes or No, is in C2. The rule below gives a special result to someone scoring at least 80 with attendance marked Yes, gives a standard Pass to anyone scoring at least 80, and otherwise returns Review. A score of 86 and attendance of Yes returns Pass with attendance.
With the score in B2 and the attendance response in C2, use:
=IFS(AND(B2>=80,C2="Yes"),"Pass with attendance",B2>=80,"Pass",TRUE,"Review")
The more specific test comes first. If the general B2-at-least-80 test came first, an 86 with Yes attendance would return Pass immediately, and the special outcome would never be reached. This is a common source of errors in IFS formulas: a broad condition placed before a narrower one can make the later result unreachable.
For a rule where either of two conditions qualifies, OR can be used similarly. For instance, with a value in A2, return “Priority” if it is marked Urgent in A2 or if the age of the request in days is at least 7 in B2:
=IFS(OR(A2="Urgent",B2>=7),"Priority",TRUE,"Standard")
Example: map status text to an action
IFS can return labels for categories that are not numeric. This is helpful when a status column uses a controlled set of values and each status should display a clearer description. Exact text comparisons must match the cell contents, including spaces and punctuation.
With a status in A2, the formula below converts Open, Closed, and On hold into descriptive labels. Anything else, including a blank cell or an unexpected spelling, returns Check status.
=IFS(A2="Open","In progress",A2="Closed","Complete",A2="On hold","Waiting",TRUE,"Check status")
A catch-all label makes inconsistencies visible instead of silently treating them as a valid category. If a blank should have its own result, add a blank check before the other conditions. With a status in A2:
=IFS(A2="","Missing status",A2="Open","In progress",A2="Closed","Complete",TRUE,"Check status")
For a workbook used by other people, consider a drop-down list to reduce spelling variations. In Excel for Microsoft 365 on Windows, select the entry cells and choose Data > Data Validation, then choose List and specify the allowed values. Excel for Mac also provides Data Validation from the Data tab, although the dialog layout can differ. Validation helps prevent new errors, but it does not automatically correct inconsistent text already in the sheet.
How to write and check an IFS formula
Build the formula in a deliberate order rather than adding conditions at random. A useful process is:
- Write down every possible category and the exact rule for assigning it.
- Put the most specific or highest-priority conditions first, especially when conditions overlap.
- Pair each test with the result Excel should return when that test is true.
- Add a final TRUE condition with a sensible default, or decide explicitly how unmatched values should be handled.
- Test boundary cases and unusual inputs, then copy the formula to the remaining rows.
In Excel for Microsoft 365 on Windows, select the result cell, type an equals sign and the function, then enter each condition-result pair separated by commas. Press Enter to calculate the result. Excel’s Function Arguments dialog is also available from the Formulas tab through Insert Function, and can help inspect arguments if a formula is difficult to read. Excel for Mac supports IFS as well; its ribbon and dialog placement can vary slightly by release. The formulas in this article use commas as argument separators. Some regional settings use semicolons instead, so follow the separator Excel expects if it reports a formula error.
When you copy a formula, confirm that its references move as intended. If each row should refer to its own score, a relative reference such as B2 is appropriate. If every row should compare against one fixed threshold stored in E1, use an absolute reference such as $E$1 in that comparison. Mixing those reference types by accident can make a formula appear correct in the first row but produce wrong results farther down.
Common IFS errors and how to fix them
- #N/A: No condition evaluated to TRUE. Add a final TRUE condition with a default result, or ensure the tests cover all valid inputs.
- Wrong category: A broad condition may appear before a more specific one. Reorder the tests and check the values at each threshold.
- Unexpected text result: Check spelling, spaces, and punctuation in both the source values and quoted text in the formula. A cell that looks blank may contain a space.
- Formula entry error: Check commas versus semicolons for your regional settings, straight quotation marks, and balanced parentheses.
- Function not recognized: The workbook may be opened in an Excel version that does not support IFS. Use a compatible version or replace the formula with nested IF functions.
Also distinguish a logical error from a data-quality problem. For example, the grade formula will assign F to a blank score because blank cells can behave like zero in numeric comparisons. If blanks should remain blank, put a blank check first. With the score in B2:
=IFS(B2="","",B2>=90,"A",B2>=80,"B",B2>=70,"C",B2>=60,"D",TRUE,"F")
That formula returns an empty string for a blank score. It does not make the cell truly empty; the cell contains a formula whose displayed result is empty. This distinction matters for counts and for other formulas that inspect the cell.
IFS compared with IF and SWITCH
Nested IF functions can express the same branching logic as IFS, but each additional outcome adds another layer of parentheses. IFS is generally easier to scan when you have several independent conditions and want a corresponding result for each. IF remains useful for a simple two-way choice, and it can be used in older Excel versions that do not support IFS.
SWITCH is another option when one expression is being compared with several exact values. It can make a mapping such as “Open” to “In progress” compact. IFS is more flexible when the tests use comparisons such as greater than, less than, or combinations with AND and OR. Neither function automatically fixes poor condition order: choose the one that makes the rule easiest to understand and maintain.
For a very large or frequently edited set of categories, a lookup table may be easier to maintain than a long formula. A table lets someone update labels or thresholds in cells rather than editing formula text. This is especially useful when the rules change regularly or need to be reviewed by someone who is not comfortable reading formulas.
Frequently Asked Questions
Does IFS return the first true result?
Yes. Excel checks the conditions in order and returns the result associated with the first condition that evaluates to TRUE. Put higher-priority or more specific conditions before broader ones.
What happens if no IFS condition is true?
If there is no matching condition and no catch-all test, IFS returns #N/A. Add a final TRUE condition and the result you want as a default, such as “Check input.”
Can I use AND or OR inside IFS?
Yes. Use AND when all requirements must be true and OR when at least one is enough. Place the combined test as one of IFS’s logical tests, and order it carefully relative to the other conditions.
Can IFS check text as well as numbers?
Yes. You can compare a cell with quoted text, such as a status label, or compare numbers with operators such as greater than or equal to. Text comparisons should match the intended labels, including spaces.
Why does my IFS formula show #NAME?
One possibility is that the Excel version opening the workbook does not support IFS. Check the version, spelling, and formula separators. Excel 2019 and later, including Microsoft 365, supports the function.
Is IFS better than nested IF?
It is often clearer when there are several condition-result pairs. Nested IF can be more compatible with older Excel versions, while SWITCH may be simpler for exact-value mappings. Choose based on the rule and the versions that must open the workbook.
Related
- How to Insert a Leader Line in Microsoft Word
- How to Insert a Line Above a Letter in Microsoft Word
- How to Insert a Line Above a Table in Word
Try it: the Formula Explainer: paste any formula and see each function and reference in plain English.
More in Formulas & functions
- Excel Formula for Years Between Dates: Exact or DecimalFor completed years between two dates in Microsoft Excel, enter a start date in A2 and an end…
- COUNTIF in Excel: Count Empty Cells and Blank Cells EasilyIf your cells are in A2:A20, use =COUNTIF(A2:A20,"") to count empty cells. COUNTIF with an empty-string criterion counts…
- Excel VLOOKUP Examples With a Drop-Down ListTo make a drop-down selection drive a lookup in Excel for Microsoft 365 on Windows, create a list…
- Excel Day Name from Date: Formulas, Formats, and FixesTo show the day name for a date in Excel, enter =TEXT(A2,"dddd") in another cell, assuming A2 contains…
- Copy Formula in Excel Without Dragging: 6 WaysTo copy a formula in Excel without dragging, copy and paste it, use Ctrl+D to fill down, or…
- Excel Formula Bar Disappeared? How to Show It AgainIf the Excel formula bar disappeared, turn it back on from View > Show > Formula Bar in…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.