Excel’s IFS function checks conditions in order and returns the value linked to the first condition that is true. For example, with a score in A2, you can assign a letter grade using =IFS(A2>=90,"A",A2>=80,"B",A2>=70,"C",A2>=60,"D",A2<60,"F"); if A2 contains 84, the result is B.
What the IFS function does
IFS is a way to choose among several outcomes without building a long chain of nested IF functions. Each condition is a logical test, such as whether a number is greater than a threshold or whether a cell contains particular text. Excel checks the tests in the order you write them and returns the value paired with the first test that evaluates to TRUE. It does not return the values for later tests.
That order matters when conditions overlap. If you test whether a score is at least 60 before testing whether it is at least 90, a score of 95 meets the first test and gets the first result. Put the most specific or highest threshold first when that is the intended priority. IFS is useful for categories, eligibility rules, labels, and other decisions where one input must be assigned one result.
IFS is available in Microsoft 365 and Excel 2019 or later, including Excel 2021 and Excel 2024. The function works the same way in the current Windows, Mac, and web editions of Excel. In installations configured for a different regional list separator, Excel may display semicolons rather than commas in formulas; the examples below use commas as requested.
How to structure an IFS formula
An IFS formula contains alternating logical tests and results: test one, result one, test two, result two, and so on. A test can use operators such as =, >, >=, <, or <=. A result can be text in straight double quotation marks, a number, a cell reference, or another calculation. Excel supports up to 127 test-and-result pairs in one IFS function, though a shorter formula is usually easier to review and maintain.
For example, with sales in B2, a rule could return one commission rate when sales reach a high threshold, another rate at a lower threshold, and a default rate otherwise. Each new pair extends the decision table. Keep the tests mutually sensible and ordered deliberately: IFS does not sort thresholds or infer which category you intended.
For readable formulas, put each test on a separate line while editing the formula bar, or use Excel’s line breaks in the formula bar with Alt+Enter on Windows. On a Mac, use Control+Option+Return to insert a line break while editing a formula. The formula itself does not change when formatted across multiple lines.
Example: assign grades from a score
Suppose numeric scores from 0 through 100 are entered in A2. With the score in A2, this formula returns a grade; a score of 84 returns B:
=IFS(A2>=90,"A",A2>=80,"B",A2>=70,"C",A2>=60,"D",A2<60,"F")
The thresholds are written from highest to lowest. That prevents a score of 95 from being categorized by the broader test for 80 or more. The final test, A2<60, makes the intended range explicit, but this particular ordering can also use a default TRUE test for all remaining numeric scores.
With scores in A2:A100, enter the formula in the adjacent grade cell for row 2, then fill it down. Excel adjusts A2 to A3, A4, and so on. If scores might contain text or be outside the 0–100 range, decide how to handle those cases rather than assuming every entry is valid. For instance, you could add checks for blank or invalid inputs before the grade thresholds.
Example: return a tier or a commission rate
IFS can map sales to a tier, price band, or rate. With sales amount in B2, this formula returns the commission rate: sales of 7,200 return 0.07, or 7 percent. Format the result cell as Percentage if you want it displayed as 7% rather than 0.07.
=IFS(B2>=10000,0.1,B2>=5000,0.07,TRUE,0.03)
The TRUE test is a catch-all: because TRUE is always true, it supplies the 3% rate when neither of the earlier thresholds is reached. In this example, the formula returns a rate, not a commission amount. To calculate the amount, multiply sales by the selected rate. With sales in B2, that complete formula returns 504 when B2 is 7,200:
=B2*IFS(B2>=10000,0.1,B2>=5000,0.07,TRUE,0.03)
The arithmetic is 7,200 × 0.07 = 504. These numbers are illustrative only; set real business rates from the applicable agreement or policy. The same structure can return text labels such as "Large", "Medium", and "Small" instead of rates.
Use AND and OR for compound conditions
A condition does not have to test just one cell. You can place AND or OR inside an IFS test when a result depends on more than one requirement. AND is true only when every condition inside it is true; OR is true when at least one is true. This can express rules such as a bonus requiring both a score threshold and a completed status.
Assume a score is in B2 and completion status is in C2. The formula below returns Bonus for a score of 90 or higher when C2 contains Yes, High score for a score of 90 or higher without that combination, and Standard otherwise. With B2 equal to 94 and C2 equal to Yes, the result is Bonus:
=IFS(AND(B2>=90,C2="Yes"),"Bonus",B2>=90,"High score",TRUE,"Standard")
Compound conditions are also useful for date ranges, departments, or combinations of status fields. Keep each rule understandable: if a formula becomes hard to inspect, use helper columns to calculate intermediate conditions or put the decision rules in a small, clearly labeled table and consider a lookup approach.
Provide a default and handle blank cells
If no logical test is true and there is no catch-all test, IFS returns the #N/A error. This is not necessarily a formula defect: it means none of the listed cases matched. Add a final TRUE test when you want a defined fallback such as "Other", "Review", or a default numeric value.
With a number in A2, this formula classifies values through 20 and labels larger values High. If A2 contains 16, it returns Medium:
=IFS(A2<0,"Below range",A2<=10,"Low",A2<=20,"Medium",TRUE,"High")
The final TRUE also means values that are not numeric may fall into the default, depending on how Excel evaluates the comparisons. If that is not appropriate, validate inputs or add a deliberate check for the expected data type. A fallback should represent a meaningful outcome, not merely hide unexpected data.
To leave the result visually blank when A2 is empty, test for that case first. With the input in A2, the formula below returns an empty text string for an empty input, Pass for 60 or more, and Review for lower values. An empty string looks blank but is not the same thing as a truly empty cell.
=IFS(A2="","",A2>=60,"Pass",TRUE,"Review")
This distinction can matter in later calculations or checks that distinguish empty cells from formulas returning empty text. If a blank input must remain genuinely empty, formulas cannot make their own cell truly empty; use a separate input cell or leave the output cell unpopulated until there is a value.
Common IFS errors and how to fix them
- #N/A: No test evaluated to TRUE. Check whether your boundaries cover the possible inputs, or add a final TRUE test with a suitable default.
- Wrong category: A broader condition may appear before a more specific one. Reorder the pairs so the first true test is the outcome you actually want.
- Text does not match: Check spelling and extra spaces in the source data and in quoted text. Excel’s ordinary text comparisons are generally not case-sensitive, but different spacing or characters can still cause a mismatch.
- Formula entry error: Confirm that every test has a paired result, that text values use straight double quotation marks, and that parentheses are balanced. Your regional Excel settings may require semicolons instead of commas.
- Function not recognized: Check the Excel version. IFS is supported in Excel 2019 and later and Microsoft 365; older installations may need nested IF functions instead.
When debugging, test the logic with a few boundary values: one just below a threshold, one exactly on it, and one just above it. For a threshold of 80, check 79, 80, and 81. This reveals whether you used > when you intended >=, or whether adjacent categories leave a gap or overlap. Also confirm that the input cells contain the data type the comparisons expect.
IFS compared with nested IF and other options
IFS is usually easier to scan than nested IF when one input is being assigned among several outcomes. Nested IF repeats the IF function inside the previous function’s false result, which can become difficult to edit as rules grow. IFS lays the test-result pairs in sequence, but it still relies on ordered conditions and still needs a default if every possible input must have an outcome.
A regular IF can be clearer when there are only two outcomes, such as Yes or No. For a lookup based on a fixed list of categories and corresponding results, a small mapping table can be easier to maintain than a long formula. Lookup functions may be preferable when users will frequently change the categories or thresholds. Choose based on whether the rules are short and stable or are better stored as data.
IFS is not a replacement for every kind of logic. It returns the first matched result; it does not return multiple results for multiple true conditions. If several conditions should contribute to one answer, an arithmetic formula or functions such as SUMIFS may fit better. If you need to test multiple independent conditions and combine their outcomes, define that rule explicitly with AND, OR, or a separate calculation.
Frequently Asked Questions
What does IFS do in Excel?
IFS tests conditions in sequence and returns the value paired with the first condition that is true. It is commonly used to assign categories, labels, or rates based on thresholds.
What happens if none of the IFS conditions are true?
Excel returns #N/A if no condition is true and the formula has no matching default. Add a final TRUE condition and the result you want to use as the fallback.
Does IFS check every condition?
IFS uses the first true condition to determine the returned result. Put conditions in the order that reflects your intended priority; later matching rules do not replace the first match.
Can I use AND or OR inside IFS?
Yes. AND or OR can form a logical test within an IFS pair, allowing one outcome to depend on multiple requirements. Make sure the pair order still reflects which result should take priority.
Can older Excel versions use IFS?
IFS is available in Excel 2019 and later, including Microsoft 365, Excel 2021, and Excel 2024. For an older version that does not support it, nested IF functions are a common alternative.
Why does my IFS formula return the wrong result?
The most common cause is condition order: an earlier, broader test may already be true. Check the sequence and test values around each threshold, including the exact boundary.
Related
- Multiply Hours by Money in Excel: A Practical Guide
- How to Multiply a List of Numbers in Excel: 10 Methods
- How to Multiply Hours by Rate in Excel and Format Totals
Try it: the Formula Explainer: paste any formula and see each function and reference in plain English.
More in Formulas & functions
- Excel Copy Data Validation to Other Cells the Right WayTo copy only a cell’s data validation in Excel for Microsoft 365 on Windows, copy the cell, select…
- Today’s Date in Excel: Shortcut and TODAY() FormulaIn Excel for Microsoft 365 on Windows, press Ctrl+; (Control plus semicolon) to insert today’s date as a…
- Count Excel Without Duplicates: Formulas That WorkTo count distinct, nonblank values in Excel for Microsoft 365, use =IFERROR(ROWS(UNIQUE(FILTER(A2:A100,A2:A100<>""))),0), replacing A2:A100 with your data range.…
- CHAR Excel Examples: Formulas, Line Breaks, and MoreIn Excel for Microsoft 365, use CHAR(number) to return the character assigned to a numeric code, such as…
- Excel Column Comparison: Formulas, Methods, and TipsTo compare two Excel columns, use a row-by-row equality test when corresponding cells should match, or check whether…
- Lowercase Names in Excel: Formula, Fill Down, and ReplaceTo lowercase names in Excel, use the LOWER function in a helper column, then fill the formula down.…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.