What it does
SWITCH compares one expression against several possible values and returns the matching result.
Syntax or pattern
=SWITCH(expression, value1, result1, [value2, result2], [default])5 practical examples
Convert codes to labels
Turn status codes into readable text.
=SWITCH(A2,"N","New","P","Pending","C","Closed","Unknown")Great for code mapping.
Month number to quarter
Return the quarter for a month number.
=SWITCH(ROUNDUP(A2/3,0),1,"Q1",2,"Q2",3,"Q3",4,"Q4")This avoids a long nested IF formula.
Priority code labels
Convert priority codes into labels.
=SWITCH(B2,1,"Low",2,"Medium",3,"High","Check")Add a default result at the end.
Department abbreviations
Expand department abbreviations.
=SWITCH(C2,"HR","Human Resources","FIN","Finance","OPS","Operations","Other")Useful for small mapping lists.
Choose calculation type
Return a different calculation based on a selected option.
=SWITCH(E2,"Margin",Profit/Sales,"Tax",Sales*TaxRate,"")For larger calculation choices, a lookup table may be easier to maintain.
Common mistakes to avoid
- Using SWITCH for numeric ranges where IFS is better.
- Forgetting the default result.
- Creating formulas that should be lookup tables.
Related Excel examples
FAQ
When should I use SWITCH instead of IFS?
Use SWITCH when you compare one value to several exact matches.
Here are some ideas for you
Optional resources that may help if you are learning formulas, building reports, or working in spreadsheets often.
- Excel formula booksSee ideas
Practice formulas with structured examples you can keep beside your desk.
- Excel shortcut guidesSee ideas
Build speed with keyboard shortcuts for selection, formatting and navigation.
- Numeric keypadsSee ideas
Helpful if you enter many numbers on a laptop or compact keyboard.
- External monitorsSee ideas
Useful for viewing large worksheets, formulas and reference tables side by side.
- Desk notebooksSee ideas
Sketch formula logic, report ideas and table structures before building.
- Laptop standsSee ideas
Make long spreadsheet sessions more comfortable and ergonomic.
Some links in this section may be affiliate links. Choose only what is useful for your own work.