The function switch evaluates an expression against a list of values and returns the corresponding matching value.

Syntax:

=Switch(expression, match value1, result1, match value2, result2,…)

Expression. Is the expression to be evaluated.

Match Value1. is the value1 to be compared with the expression

Result1. is the result1 to be returned if the corresponding value1 matches the expression

Match Value2. is the value2 to be compared with the expression

Result2. is the result2 to be returned if the corresponding value2 matches the expression