Spreadsheet formulas explained, side by side

SWITCH Function in Excel, Google Sheets, Airtable & Notion

SWITCH compares one value against a list of options and returns the result paired with the first exact match, or a default if nothing matches.

Syntax in each app

AppSupportSyntax & notes
Excel✔ Built inSWITCH(expression, value1, result1, [value2, result2], ..., [default])
Excel 2019 / 365
Google Sheets✔ Built inSWITCH(expression, case1, value1, [case2, value2, ...], [default])
Airtable✔ Built inSWITCH(expression, pattern, result, ..., [default])
Notion≈ Workaroundifs(x == "a", result1, x == "b", result2, ..., default)
Notion has no switch(); compare the value in each condition of ifs(). Text comparison with == is case-sensitive.
Try SWITCH with your own values
One item per line
One item per line
Leave empty for no default
Result (as Excel & Google Sheets return it)
Medium 6 characters
Your formula, ready to paste
Excel=SWITCH("M", "S", "Small", "M", "Medium", "L", "Large", "Unknown") open excel.new ↗
Google Sheets=SWITCH("M", "S", "Small", "M", "Medium", "L", "Large", "Unknown") open sheets.new ↗
AirtableSWITCH("M", "S", "Small", "M", "Medium", "L", "Large", "Unknown")
Notion
workaround
ifs("M" == "S", "Small", "M" == "M", "Medium", "M" == "L", "Large", "Unknown")

Excel and Google Sheets compare text without regard to case. The Notion version uses ==, which is case-sensitive, and returns empty text instead of an error when nothing matches.

Arguments

ArgumentWhat it means
expressionThe value to check, usually a cell such as A2.
value1, result1If expression equals value1, return result1.
[value2, result2], ... optionalMore pairs, checked in order.
[default] optionalReturned when nothing matches. Without it, Excel and Google Sheets return #N/A.

Examples

FormulaResultWhyCopy
=SWITCH("M", "S", "Small", "M", "Medium", "L", "Large", "Unknown")Medium
=SWITCH("XL", "S", "Small", "M", "Medium")#N/ANo match and no default.
=SWITCH(WEEKDAY(A2), 1, "Weekend", 7, "Weekend", "Weekday")"Weekend" or "Weekday"Map numbers to labels.

Examples use Excel / Google Sheets syntax unless noted.

How SWITCH works

SWITCH is the tidy way to translate codes into labels: status codes into names, region abbreviations into full names, size letters into descriptions. It only does exact matches. For ranges such as "80 and above", use IFS instead; for long or frequently changing lists, keep a two-column table and use XLOOKUP or VLOOKUP so you can edit the mapping without touching the formula.

Arguments come in pairs after the expression. If the total number of arguments after the expression is odd, the last one is the default. Forgetting the default means unmatched values show #N/A in Excel and Google Sheets. Airtable's SWITCH() has the same shape and is the usual way to map single-select options to other values.

Notion has no switch(), so the copy button writes the equivalent ifs(): each condition compares the value with ==, and the final argument is the default. With a property it reads ifs(prop("Size") == "S", "Small", prop("Size") == "M", "Medium", "Unknown").

Frequently Asked Questions

Can SWITCH test conditions like greater than?
Not directly; it compares for equality. A common trick is =SWITCH(TRUE, A2>=90, "A", A2>=80, "B", "C"), but IFS is clearer.
Does SWITCH work in Excel 2016?
No. SWITCH needs Excel 2019 or Microsoft 365. In older versions, nest IF or use a lookup table.

Part of the Logical functions. Results in the tester follow Excel and Google Sheets behaviour; always double-check important work in your own file.