✍️ Excel logical examples

SWITCH Examples in Excel

Learn SWITCH examples for replacing codes, statuses, months and repeated IF formulas.

Updated 2026-06-125 practical examplesCopy-ready

💡 Ideas for You

Learning resources for Excel formulas, spreadsheets and reporting.

4 useful links

Some links in this section may be affiliate links. Choose only what is useful for your own work.

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

1

Convert codes to labels

Turn status codes into readable text.

=SWITCH(A2,"N","New","P","Pending","C","Closed","Unknown")

Great for code mapping.

2

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.

3

Priority code labels

Convert priority codes into labels.

=SWITCH(B2,1,"Low",2,"Medium",3,"High","Check")

Add a default result at the end.

4

Department abbreviations

Expand department abbreviations.

=SWITCH(C2,"HR","Human Resources","FIN","Finance","OPS","Operations","Other")

Useful for small mapping lists.

5

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.