Get the IFS Function Practice Workbook
Follow along with both examples from the tutorial: the salary comparison and the emoji rating with conditional formatting. Includes the nested IF version for comparison.
Why Use the IFS Function?
Before the IFS function, handling multiple conditions in Excel meant nesting several IF statements, which often became messy.
The IFS function allows you to evaluate conditions one by one and return the result for the first true condition. This not only makes your formulas easier to read but also reduces errors.
IFS Function Syntax
The IFS function checks conditions one by one in the order you list them. The function can handle up to 127 of these conditions.
Here’s how you write it:
=IFS(test1, value1, [test2, value2], …)- test1: This is the first thing it checks.
- value1: This is what you get if test1 is true.
- test2, value2: Second test and results you can add. (optional)
It checks each thing one by one until it finds something true. Then, it stops and gives you the result for that true thing. If it finds nothing true, it shows an error (#N/A).
IFS works in Excel 2019, 2021, 2024 and Microsoft 365, on Windows and Mac. Older versions show a #NAME? error.
A Simple Way to Picture IFS
Imagine you have three light switches (test1, test2, test3), each controlling a different color light: blue, red, and green.
The goal is for Excel to identify which light is on using the IFS function.

Here’s how it works:
=IFS(test1, "blue", test2, "red", test3, "green")- Step 1: Check switch 1. If it’s on, Excel returns “blue”.
- Step 2: If switch 1 is off, check switch 2. If it’s on, Excel returns “red”.
- Step 3: If switch 2 is off, check switch 3. If it’s on, Excel returns “green”.
If none of the switches are on, Excel will return an error (#N/A) because it didn’t find any true condition.
❗The order matters! The IFS function stops as soon as it finds the first switch that’s on. Even if later switches are on, they won’t be checked if an earlier switch was already on.
Example: Compare Values Against a Target
Imagine you need to compare employee salaries against a company average of $50,000:

The formula for the first employee’s salary test will be placed in cell C6.
=IFS(B6>$C$3, "Higher", B6<$C$3, "Lower", TRUE, "Same")The IFS Formula Explained:
- First, the formula checks if the salary in cell B6 is higher than the average salary in cell C3. If yes, it shows “Higher“.
- Next, it checks if the salary in B6 is lower than the average in C3. If this is true, it shows “Lower“.
- Finally, the part that says TRUE, “Same” acts as a catch-all for any salary that is exactly the average. It means if the salary didn’t fit in the first two categories, it must be equal to the average, so it shows “Same“.

This formula checks if each salary is higher, lower, or the same as the average in C3. TRUE acts as a catch-all, so any salary that is not higher or lower shows Same.
Check Each Test With F9
Not sure why a formula returns the wrong result? Click into the formula bar and select one test, like B6>$C$3. Press F9. Excel shows TRUE or FALSE for that part.
Press Esc when you are done. If you press Enter, the result replaces that part of your formula.
Example: Show an Emoji for Each Rating
In this example, we want to show a specific emoji based on the participant’s level of satisfaction selected from a dropdown list.
As an extra touch, we want to conditionally format (color) the Emojis.

Create the Dropdown List
- First, we create a dropdown list for participants to choose their level of satisfaction.
- This is done with Data Validation. Here is how to create a drop-down list in Excel.
Return an Emoji for Each Rating
- In cell C17, we’ll input the IFS formula that displays a unique emoji based on the selected satisfaction level:
=IFS(B17="Amazing", "😍", B17="Good", "🙂", B17="Average", "😶", B17="Bad", "😪", TRUE, "")Insert Emojis With Win + Period
- While typing in the formula bar, press Win + period to open the emoji library.


💡Emojis are treated like text and must be enclosed in quotation marks.
Color the Emojis With Conditional Formatting
To make our feedback visually appealing, we’ll color-code the emojis based on the satisfaction level using Conditional Formatting.

Steps to Apply Conditional Formatting:
- Highlight the cells containing the IFS function (in this example, C17 through C24).
- Go to Home tab, find the Styles group, and click on Conditional Formatting.
- Choose Highlight Cells Rules > Equal To. You can also use New Rule > Format only cells that contain. Both work.
- In the dialog box, press Win + . to bring up the emoji list and select the emoji you want to color-code.
- Choose your color scheme. For more options, click on Custom Format….
- Repeat these steps for each emoji to apply different colors accordingly.
IFS Function vs. Nested IF
Using the IFS function simplifies what could otherwise be a complex series of nested IF statements.
For example, to convert ratings (1-5) into text descriptions:
Nested IF Version
=IF(A1=5, "Excellent", IF(A1=4, "Good", IF(A1=3, "Neutral", IF(A1=2, "Fair", IF(A1=1, "Poor", "N/A") ) ) ) )This formula can be tricky to manage because it involves five IF functions nested within each other, requiring you to keep track of five sets of parentheses. It can quickly become a headache, especially as the complexity increases.
IFS Version
=IFS(A1=5, "Excellent", A1=4, "Good", A1=3, "Neutral", A1=2, "Fair", A1=1, "Poor", TRUE, "N/A")The IFS function is easier to read, modify, and reduces the likelihood of errors.
Key Differences
- Nested IFs Complexity: With nested IFs, you could end up with up to 64 levels of IFs. Imagine trying to navigate through all those parentheses!
- IFS Simplicity: The IFS function allows for up to 127 decisions within a single, more manageable function.
How to Match Parentheses in Excel Formulas
When you use nested formulas in Excel, the program color-codes parentheses to help you match them correctly.
Excel cycles through a set of colors for each new level of parentheses. The colors repeat, but black is only used for the outermost pair.
When you’re closing a complex formula, just keep adding closing parentheses until you see the black pair. That’s your signal to stop.

Tips for Using the IFS Function
- Order Matters: The IFS function evaluates conditions in the order they appear. Always place the most specific conditions first.
- Avoid #N/A Errors: If no test is TRUE, IFS returns #N/A. End with TRUE and a default value to catch everything else.
Bonus: Use a Lookup Table Instead of a Long IFS
IFS is great for a handful of tests. But when you match exact values, like a rating word to an emoji, a small lookup table is easier to maintain.
Put each rating in one column and its result in the next. Then look it up:
=IFNA(VLOOKUP(B2,$E$2:$F$5,2,FALSE),"")VLOOKUP finds the rating and returns the result from the second column. IFNA returns an empty cell when there is no match, so you never see #N/A.
With XLOOKUP you can skip IFNA. Its fourth argument handles the not found case:
=XLOOKUP(B2,$E$2:$E$5,$F$2:$F$5,"")Need to change a result or add a rating? Edit the table. The formula stays the same.
Download the IFS Function Workbook
Get the Free Workbook
Practice both IFS examples and compare them with the nested IF version.
Frequently Asked Questions
What is the difference between IF and IFS in Excel?
IF tests one condition and returns one of two results. To test more conditions, you nest IF inside IF. IFS tests up to 127 conditions in one function and returns the result for the first test that is TRUE, so there is no nesting to keep track of.
Why does my IFS formula return #N/A?
IFS returns #N/A when none of the tests is TRUE. Add TRUE as the last test with a default value, like TRUE, "Same". If a test returns something other than TRUE or FALSE, you get #VALUE! instead.
How do I add an else value to the IFS function?
IFS has no separate else argument. Use TRUE as the final test and put the default result after it: =IFS(B6>$C$3, "Higher", B6<$C$3, "Lower", TRUE, "Same"). TRUE is always true, so anything that fails the other tests lands there.
Which Excel versions have the IFS function?
IFS works in Excel 2019, 2021, 2024 and Microsoft 365, on Windows and Mac. Older versions show a #NAME? error. There you need a nested IF formula instead.
Should I use IFS or XLOOKUP?
Use IFS for comparisons, like greater than or less than a target. When you match exact values, a small lookup table with =XLOOKUP(B2,$E$2:$E$5,$F$2:$F$5,"") is easier to maintain. To change a result, you edit the table, not the formula.
How do I insert an emoji in an Excel formula?
While you type the formula, press Win + period on Windows to open the emoji panel. On a Mac, press Control + Command + Space. Emojis count as text, so put them in quotation marks inside the formula.
Leila Gharani
Founder of XelPlus and ten-time Microsoft MVP. Leila helps over 500,000 professionals master Excel, Power BI, and data automation through practical, real-world training.







