SWITCH

Checks a condition and reacts according to the defined conditions.

SWITCH requires at least three arguments: a condition and a value that is displayed when the condition is met, and a default value that is displayed when none of the conditions listed is met.

It is also possible to link conditions with the IF formula. This however, would require a longer expression.

Example

=SWITCH(A1>10;"red";A1>5;"yellow";A1>2;"green";"black")

SWITCH

In comparison, the expression when IF is used:

=IF(A1>10;"red";IF(A1>5;"yellow";IF(A1>2;"green";"black")))