What is SWITCH in Google Sheets?

SWITCH evaluates an expression against a list of case values and returns the result for the first match. A default value catches everything else. It cleans up nested IF chains when you compare one cell to many constants like status codes.

When to use it

Use SWITCH for enumerated mappings: region codes to names, numeric ratings to labels, or single-field category translation.

When to skip it

Skip SWITCH when each branch needs different range comparisons. Use IFS for conditions like A1>100.

How it works

  1. 1

    Pass the expression to test, usually a cell reference.

  2. 2

    Alternate case value and result pairs for each allowed match.

  3. 3

    End with a default result if no case matches.

  4. 4

    Keep case values type-consistent with the expression, text vs number.

  5. 5

    Order cases from most specific to general when overlaps could occur.

  6. 6

    Document case list on Settings tab when business adds new codes.

Examples in Google Sheets

Status label

=SWITCH(D2, "O", "Open", "C", "Closed", "P", "Pending", "Unknown") maps codes to words.

Region name

=SWITCH(B2, 1, "East", 2, "West", 3, "Central", "Other") turns numeric region ids into names.

Commission rate

=SWITCH(C2, "Gold", 0.1, "Silver", 0.07, "Bronze", 0.05, 0) assigns rate by tier text.

Build this without starting from a blank cell

Use a Better Sheets tool for SWITCH, then watch a walkthrough when you want the full pattern.

Better Sheets resources

Common mistakes

  • Mixing text and number cases so "1" never matches 1.
  • No default argument leaving #N/A on unexpected values.
  • Using SWITCH for inequalities like greater than thresholds.
  • Duplicate case values where only first wins without notice.
  • Huge SWITCH lists better moved to a lookup table with XLOOKUP.

Frequently asked questions

SWITCH vs IFS?
SWITCH matches exact values. IFS handles separate logical conditions.
SWITCH vs nested IF?
SWITCH is shorter when comparing one expression to many constants.
SWITCH vs VLOOKUP?
Large tables belong in lookup ranges. SWITCH suits small inline maps.
Default value required?
Optional but recommended to avoid errors on unknown codes.
SWITCH on arrays?
Expression can be a range; SWITCH spills results per row in array context.
Case sensitive?
Text matches follow normal equality rules.
SWITCH with expressions?
First argument can be formula, but cases are still exact value matches.

Related Tutorials

Watch how SWITCH works

Browse more tutorials
Switch Data

Switch Data

We're going through the switch formula because in the past if I've ever ...
How do I reference a different spreadsheet in Apps Script?

How do I reference a different spreadsheet in Apps Script?

I'll show you how to get text from one spreadsheet file to another with ...
Move Entire Row when a Cell is changed to "Yes" - The $75,000 Google Script

Move Entire Row when a Cell is changed to "Yes" - The $75,000 Google Script

This is one of the most popular asked first "automations". How to move a...
Create Navigation Buttons in Sheets to Other Sheets

Create Navigation Buttons in Sheets to Other Sheets

Add a button to go to another sheet inside your sheet.
5 Ways to use IF() Formula to Create Magic in Your Sheets

5 Ways to use IF() Formula to Create Magic in Your Sheets

We're going to create some magic here. Some if magic, sprinkle a little ...
Visicalc 2023 Technical Walkthrough

Visicalc 2023 Technical Walkthrough

welcome to the technical walkthrough of VisiCalc 2023. This is the sheet...

Related blog posts

Guides that explain SWITCH in more depth.

Browse the blog

Related glossary terms

Done reading about SWITCH?

Membership unlocks 636+ tutorials, unlimited generators, and every template. Practical lessons. Zero fluff.

Need this once

Jump to a free tool or a single tutorial for this topic.

Learning Sheets for real

Unlock the full library, generators, and templates with membership.