SWITCH Function in Excel: Match One Value Against a List

⏱ 1 min readUpdated 28 September 2026

LogicalLevel: IntermediateAvailable in: Excel 2019+

In this article
  1. Syntax
  2. Examples
  3. Example 1
  4. Example 2
  5. 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 article

Stuck on a step? Ask a question and the AI answers using this article.

Free · AI can be wrong