Quick Answer & Formula
Excel
Sheets
Beginner
=SWITCH(expression, val1, result1, [val2, result2, ...], [default]) The SWITCH function evaluates a single expression against a list of values and returns the result corresponding to the first matching value, with an optional fallback default.
SWITCH Function in Excel & Google Sheets
The SWITCH function evaluates a single cell or formula against a list of possible matches and returns the corresponding result.
1. Mapping Status Codes to Text
=SWITCH(A2, 1, "Active", 2, "Pending", 3, "Suspended", 4, "Cancelled", "Unknown Status")
2. Converting Weekday Numbers to Day Names
=SWITCH(
WEEKDAY(A2),
1, "Sunday",
2, "Monday",
3, "Tuesday",
4, "Wednesday",
5, "Thursday",
6, "Friday",
7, "Saturday"
)
?
Frequently Asked Questions
When should I use SWITCH instead of IFS?
Use SWITCH when you are evaluating a SINGLE cell or expression against exact values (e.g. mapping code 1, 2, 3 to Low, Med, High). Use IFS when you are testing multiple different boolean conditions (e.g. > 100, < 50).