Status label
=SWITCH(D2, "O", "Open", "C", "Closed", "P", "Pending", "Unknown") maps codes to words.
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.
Use SWITCH for enumerated mappings: region codes to names, numeric ratings to labels, or single-field category translation.
Skip SWITCH when each branch needs different range comparisons. Use IFS for conditions like A1>100.
Pass the expression to test, usually a cell reference.
Alternate case value and result pairs for each allowed match.
End with a default result if no case matches.
Keep case values type-consistent with the expression, text vs number.
Order cases from most specific to general when overlaps could occur.
Document case list on Settings tab when business adds new codes.
=SWITCH(D2, "O", "Open", "C", "Closed", "P", "Pending", "Unknown") maps codes to words.
=SWITCH(B2, 1, "East", 2, "West", 3, "Central", "Other") turns numeric region ids into names.
=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.
Watch how SWITCH works
Guides that explain SWITCH in more depth.
5 ways to use the IF function in Google Sheets ISBLANK() Checkbox AND() OR() IF(IF())
Read post →Today’s tutorial will cover how to bring a value from other cells. How do you reference an array in a cell? Anika is a member of Better Sheets and she was the one who asked this question.
Read post →Nothing is better than Google Sheets. You just need to learn more about the unlimited power of Google Sheets. Functions, Formulas, Apps Script and more.
Read post →IFS runs several condition-result pairs in order and returns the result for the first condition that is TRUE. It replaces long nested IF trees for tiered scoring, bonus bands, and SLA buckets where each step tests a comparison.
Read guide →LET assigns names to calculated values inside one formula, then uses those names in the final expression. Repeated VLOOKUP keys, tax rates, or date bounds appear once, which shrinks formulas and can reduce recalc work on heavy sheets.
Read guide →FILTER returns only the rows from a range that meet one or more conditions. Conditions are boolean arrays the same height as the data. FILTER spills results automatically, so it replaced many INDEX/SMALL helper-column patterns for live subsets.
Read guide →XLOOKUP searches a lookup array for a key and returns a matching value from a return array. It handles left lookups, approximate match, and custom not-found text without INDEX/MATCH gymnastics.
Read guide →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.