How to Use IFS in Excel: Simple Guide with Examples
Use the
IFS function in Excel to test multiple conditions in order and return a value for the first true condition. The syntax is =IFS(condition1, value1, condition2, value2, ...), where each condition is checked one by one until one is true.Syntax
The IFS function checks multiple conditions and returns a value for the first condition that is true.
- condition1, condition2, ...: These are the logical tests you want to check.
- value1, value2, ...: These are the results returned when the corresponding condition is true.
You can add up to 127 condition-value pairs.
excel
=IFS(condition1, value1, condition2, value2, ...)
Example
This example shows how to assign grades based on a score using IFS. It checks the score and returns the correct grade.
excel
=IFS(A2>=90, "A", A2>=80, "B", A2>=70, "C", A2>=60, "D", TRUE, "F")
Output
If A2 is 85, the output is "B"
Common Pitfalls
Common mistakes when using IFS include:
- Not including a final
TRUEcondition to catch all other cases, which can cause errors if no conditions are met. - Using overlapping conditions that cause unexpected results because
IFSstops at the first true condition. - Forgetting to match each condition with a value, which leads to formula errors.
excel
=IFS(A2>90, "A", A2>80) <em>(Wrong: missing value for second condition)</em> =IFS(A2>90, "A", A2>80, "B", TRUE, "F") <em>(Right: all conditions have values and a catch-all TRUE)</em>
Quick Reference
| Part | Description |
|---|---|
| condition1 | First logical test to check |
| value1 | Result if condition1 is TRUE |
| condition2 | Second logical test if condition1 is FALSE |
| value2 | Result if condition2 is TRUE |
| TRUE | Optional catch-all condition for any other case |
| value | Result for catch-all condition |
Key Takeaways
Use IFS to test multiple conditions without nested IFs for cleaner formulas.
Always include a final TRUE condition to handle unexpected cases.
Each condition must have a matching value to avoid errors.
IFS stops checking after the first TRUE condition, so order matters.
Use IFS for clear, readable conditional logic in Excel.