SWITCH

Tests an expression against a list of cases and returns the corresponding value of the first matching case, with an optional default value if nothing else is met.

Parameter List

Syntax
SWITCH(expressioncase1value1)
expression

The value or expression that will be evaluated.

case1

The first case to compare against the expression.

value1

The value to return if the expression matches case1.

Examples

SWITCH(A1, 1, One, 2, Two, Other) returns One