Home › Functions › Logical › SWITCH
fx
SWITCH
Logical  ·  Since: Excel 2019  ·  9 languages

The SWITCH function evaluates one value (called the expression) against a list of values, and returns the result corresponding to the first matching value. If there is no match, an optional default value may be returned.

🌐 Translations

English SWITCH
Deutsch ERSTERWERT
Français SI.MULTIPLE
Español CAMBIAR
Italiano SWITCH
Português PARÂMETRO
Nederlands SCHAKELEN
Polski PRZEŁĄCZ
Русский ПЕРЕКЛЮЧ

📦 Availability

Excel versionAvailable
Excel 2007 ✗
Excel 2013 ✗
Excel 2019 ✓
Excel 2021 ✓
Microsoft 365 ✓
Translate a formula with this function
fx EN
fx DE

⌨ Syntax

SWITCH(expression,value1,result1,[default_or_value2,result2],...)

Arguments

expression (required) — Expression is the value (such as a number, date or some text) that will be compared against value1…value126.
value1...value126 (required) — ValueN is a value that will be compared against expression.
result1...result126 (required) — ResultN is the value to be returned when the corresponding valueN argument matches expression. ResultN and must be supplied for each corresponding valueN argument.
default (optional) — Default is the value to return in case no matches are found in the valueN expressions. The Default argument is identified by having no corresponding resultN expression (see examples). Default must be the final argument in the function.

▶ Examples

=SWITCH(A3,1,"Sunday",2,"Monday",3,"Tuesday")
=SWITCH(A5,1,"Sunday",7,"Saturday","weekday")
=SWITCH(A4,1,"Sunday",2,"Monday",3,"Tuesday","No match")

Related functions

Copied to clipboard