Excel Switch Function

There are two ways to “excel switch function”: the quick way you copy and the durable way you understand. This page gives you both. The exact Excel answer is above; below, we build the small mental model that makes the fix stick, so the next variation of the same problem solves itself.

Exact answer

In Excel: use =SWITCH(expression, case1, result1, case2, result2, …, default) — it matches one value against a list of exact cases. Function availability: SWITCH: Excel 2019+. These are Microsoft's version markers; earlier perpetual releases do not include these functions. Check the actual product and update channel before using the formula. A marker does not establish an identical Web/Mac workflow or Google Sheets support.

On this page8

Syntax

=SWITCH(expression, value1, result1, [value2, result2], ..., [default])

Arguments

Argumentrequired / optionalDescription
expressionrequiredThe value to compare against each case.
value1requiredThe first case to match exactly.
result1requiredWhat to return when the first case matches.
defaultoptionalAn odd final argument becomes the fallback when nothing matches.

Related functions

IFSCHOOSEIF
▤Annotated stepsExcel
1

Function availability: SWITCH: Excel 2019+. These are Microsoft's version markers; earlier perpetual releases do not include these functions. Check the actual product and update channel before using the formula. A marker does not establish an identical Web/Mac workflow or Google Sheets support.

2

Confirm the mapping is exact-match — any "greater than" logic needs IFS instead.

3

Type =SWITCH( and enter the cell or expression to test.

4

Add each case and its result as a pair, separated by commas.

5

Add one final unpaired argument as the default for unmatched values.

Ctrl+CthenCtrl+Shift+V⌘+Cthen⌘+Ctrl+VPaste values · WindowsMac

What this does

SWITCH evaluates an expression once and compares it against a list of exact values, returning the result paired with the first that matches. Where IFS handles arbitrary conditions such as ranges, SWITCH is for exact-match mapping — a status code to a label, a country code to a region, an abbreviation to a full name. Its default is supplied by an unpaired final argument, which is more compact than IFS's trailing TRUE. It cannot express a range comparison at all, so anything involving "greater than" belongs in IFS. Requires Excel 2019 or later. Most people learn this as a sequence of clicks and forget it by next week; learning it as a pattern instead is what lets you apply it to the next, slightly different version of the problem without starting from scratch. That is the difference this page is trying to make. For “excel switch function”, the reliable version is a short checking loop, not just the first command that appears to work. Run it on a deliberately small range first, watch how the affected formula change, and only then apply the same setup to the full sheet. When a formula is involved, keep the inputs labelled beside it, reference cells instead of typing values, and apply number formatting only after the result checks out. That is what makes a workflow that saves repeating the same clicks every week useful in real work: repeatable, auditable, and not dependent on memory or luck.

A worked example

Mapping status codes: =SWITCH(B2, "P", "Pending", "A", "Approved", "R", "Rejected", "Unknown") returns a readable label, with "Unknown" as the fallback for anything else. Mapping a month number to a quarter: =SWITCH(ROUNDUP(A2/3,0), 1,"Q1", 2,"Q2", 3,"Q3", 4,"Q4"). SWITCH turns a code-to-label mapping into one readable line, and knowing its exact-match limit tells you when to reach for IFS instead. Check the referenced cells, argument order and result type in your workbook. Start with the worked example before changing an input, then compare the changed result with the calculation you expected. An error value or a result of a different type is a reason to inspect the inputs and arguments.

In Google Sheets

Function availability: SWITCH: Excel 2019+. These are Microsoft's version markers; earlier perpetual releases do not include these functions. Check the actual product and update channel before using the formula. A marker does not establish an identical Web/Mac workflow or Google Sheets support. Nothing on this page is behind a login or a download: the exact answer is at the top, and the detail below it is there for when you need it. That is the whole promise here — the answer first, and just enough context to make it stick. For “excel switch function”, keep the input cells and the result visible while you check the formula in Excel. Follow the worked example and change one input at a time. The steps explain the workbook calculation; this page does not run a live calculator for that task.

Common mistakes

  • Trying to express a range, which SWITCH cannot do — it compares for equality only.
  • Losing count of the pairs, so the intended last result is read as the default.
  • Building a long mapping in SWITCH where a lookup table plus XLOOKUP would be easier to maintain.

Frequently asked questions

When should I use SWITCH instead of IFS?

When you are matching one value against a list of exact possibilities. IFS is for conditions such as ranges.

How do I set a default?

Add a single unpaired argument at the end. If the argument count is odd, the last one is the default.

Is a lookup table better?

Usually, once the mapping exceeds about six cases — a table plus XLOOKUP can be edited without touching a formula.

Which Excel release does this formula require?

Function availability: SWITCH: Excel 2019+. These are Microsoft's version markers; earlier perpetual releases do not include these functions. Check the actual product and update channel before using the formula. A marker does not establish an identical Web/Mac workflow or Google Sheets support.