Match an expression against a list of values and return the first matching result.
Syntax
SWITCH(expression, value1, result1, [value2, result2], …, [default])Arguments
expressionrequired
The value to match.
value1/result1required
A value to compare and its result.
defaultoptional
Result when nothing matches.
SWITCH compares one expression to several possible values and returns the result for the first match — cleaner than nested IFs when mapping codes to labels. Add a final default for unmatched cases. Available in Microsoft 365 and Excel 2019+.
=SWITCH(A2, "N", "North", "S", "South", "Other")→NorthMaps a code to a label, with a default.
Pick the expression
Choose the cell/value to match.
List value/result pairs
Add a default at the end for safety.
SWITCH compares one expression to exact values; IFS evaluates independent conditions (ranges, comparisons).