SWITCH in Excel & Google Sheets
SWITCH is used in 1 formula pattern in this library. Browse worked examples below, or use the generator to build a custom variation for your specific data.
When to use SWITCH
- Translate a status code into a label, map a region abbreviation to a full name, or convert a number to a day or month name.
Worked examples (1)
Common errors with SWITCH
SWITCH returns
No value matched and no default was provided. Add a final argument after the last value-result pair to serve as the default — SWITCH(A2,"A","Alpha","B","Beta","Unknown").
SWITCH is not available
SWITCH requires Excel 2019 or Excel 365. Use nested IFs or an INDEX/MATCH lookup table for older versions.
Frequently asked questions
When should I use SWITCH instead of IFS?
Use SWITCH when you are comparing one expression against multiple exact values. Use IFS when each condition is a different comparison (greater than, less than, contains, etc.).
Need a custom variation?
Describe your specific SWITCH problem and get a formula written for your exact data.
Open generator with SWITCH