New: ready-to-use spreadsheet templatesExplore the collection  →
Home/Formulas/SWITCH
LOGICAL · GOOGLE SHEETS

SWITCH
match one expression against a list of cases.

Use SWITCH to expand a short code into a label. This guide shows the exact structure, a working example and the mistakes most likely to break it.

JosephineVerified by JosephineReviewed July 25, 2026
THE FORMULA=SWITCH(expression, case1, value1, [case2, value2, …], [default])
A

expressionvalue to evaluate

B

casepossible match

C

valueresult for that case

D

defaultoptional fallback

TRY IT YOURSELF

Change the sheet.
Watch the answer update.

Edit any highlighted cell below. The example recalculates immediately.

LIVE PLAYGROUND=SWITCH(A2,"N","North","S","South","Other")
fx=SWITCH(A2,"N","North","S","South","Other")
A · STATUSB · VALUE
2
3
4
5
RESULTCompleteUpdates live

Try changing a value above. This example runs entirely in your browser.

IN PLAIN ENGLISH

How the formula
thinks.

  1. 01

    expressionvalue to evaluate

  2. 02

    casepossible match

  3. 03

    valueresult for that case

  4. 04

    defaultoptional fallback

COMMON FIXES

When SWITCH
doesn’t behave.

WRONG RESULT

Wrong result

Check that every range starts and ends on the same rows, and that numbers are stored as numbers.

FORMULA PARSE ERROR

Formula parse error

Check commas, quotation marks and closing parentheses. Your locale may use semicolons instead of commas.

UNEXPECTED BLANKS

Unexpected blanks

Test the source cells for hidden spaces, empty strings and inconsistent data types.

fxNeed help with SWITCH?Fix my formula →