✍️ 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

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.

💡 Useful resources

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 books

    Practice formulas with structured examples you can keep beside your desk.

    See ideas
  • ⌨️
    Excel shortcut guides

    Build speed with keyboard shortcuts for selection, formatting and navigation.

    See ideas
  • 🔢
    Numeric keypads

    Helpful if you enter many numbers on a laptop or compact keyboard.

    See ideas
  • 🖥️
    External monitors

    Useful for viewing large worksheets, formulas and reference tables side by side.

    See ideas
  • 📒
    Desk notebooks

    Sketch formula logic, report ideas and table structures before building.

    See ideas
  • 💻
    Laptop stands

    Make long spreadsheet sessions more comfortable and ergonomic.

    See ideas

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