Excel & Google Sheets Function
SWITCH function in Excel (with interactive examples)
SWITCH matches one expression against a list of exact values and returns the first matching result, with an optional default fallback.
Syntax
=SWITCH(expression, value1, result1, [value2, result2], ..., [default])Live Interactive Exercise — Try it nowNo login required
Interactive practice grid (SWITCH reference)
Try our live spreadsheet engine: total Q1 sales in cell B5 using =SUM(B2:B4).
B5fx
| A | B | |
|---|---|---|
| 1 | Month | Sales |
| 2 | Jan | $1,100.00 |
| 3 | Feb | $1,350.00 |
| 4 | Mar | $1,550.00 |
| 5 | Total | type here |
Insert:
Arguments explained
| expression | Required | Cell or formula evaluated once. |
| value1 | Required | First exact match value. |
| result1 | Required | Returned output for value1. |
Common errors & fixes
#N/A: Always include a trailing default value if unexpected codes can appear.
Excel vs Google Sheets
Identical in Excel and Google Sheets.
Practise SWITCH in a full 4-minute lesson
Every lesson is free to study — build real speed with instant feedback.
Free 1-Page Excel, Google Sheets & SQL Interview Cheat Sheet
The 25 formulas, keyboard shortcuts, and SQL patterns tested most in analyst interviews — emailed instantly, zero spam.