
LogicalLevel: IntermediateAvailable in: Excel 2019+
In this article
- Syntax
- Examples
- Example 1
- Example 2
- Related functions
SWITCH compares one value with a list and returns the matching result — cleaner than nested IFs for exact matches.
Syntax
=SWITCH(expression, value1, result1, [value2, result2], ..., [default])
| Argument |
What it means |
default |
Result when nothing matches. |
Examples
Example 1
=SWITCH(B2, "N", "North", "S", "South", "E", "East", "W", "West", "Unknown")
Expand region codes.
Example 2
=SWITCH(WEEKDAY(A2, 2), 6, "Weekend", 7, "Weekend", "Weekday")
Weekend flag.
IFS · IF · CHOOSE
📚 Part of the free Excel course: Beginner → Expert · Try it in the Formula Lab or ask the AI Helper.
✨ Ask AI about this articleStuck on a step? Ask a question and the AI answers using this article.
Free · AI can be wrong