Match an expression against a list of values and return the first matching result.
This function works the same in Google Sheets as it does in Excel — same syntax and arguments.
SWITCH(expression, value1, result1, [value2, result2], …, [default])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")Result: North
Maps a code to a label, with a default.
SWITCH compares one expression to exact values; IFS evaluates independent conditions (ranges, comparisons).