This function compares specified expression against given list of values and returns the result according to the first matching value.
SWITCH(expression,value, result, result_no_match)
This function has the following arguments:
Argument | Description |
---|---|
expression | Value or expression to compare |
value | Value compared against expression |
result | Value returned if comparision matches |
result_no_match | Value returned if comparision do not match |
In this function, argument value and result can take upto 126 different entries each.
Accepts data of any type. Returns data of any type.
SWITCH(WEEKDAY(A2),1,"Sunday",2,"Monday",3,"Tuesday","No match") gives the result No match.