Translate a formula with this function
⌨ 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")