SWITCH
Evaluates an 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.
Syntax
SWITCH(expression, value1, result1, [value2, result2], ..., [default])
Parameters
- expression: Required. The value to be compared against value1...valueN
- value1: Required. The first value to compare against expression
- result1: Required. The result to return when the corresponding valueN matches expression
- default: Optional. The value to return if no matches are found
Example
=SWITCH(A1, 1, "Jan", 2, "Feb", 3, "Mar", "Unknown")