Function Index

Switch

Returns the result corresponding to the first matching value.

Usage

Switch(<value>, <case 1>, <result 1>, <case 2>, <result 2>, ..., <else>)

value (required) The value to test.

case 1 (required): The case to test the value against. If the <value> matches <case>, the following <result> is returned.

result 1 (required): The result to be returned if its preceding case matches the input value.

case 2+, result 2+ (optional): Several <case> <result> pairs can be listed in a single function. Every supplied case must have a corresponding result.

else (optional): The result to be returned if no cases match the value. If no <else> condition is supplied, a Null result is returned when no cases are met.

Examples

Switch(1, 0, "None", 1, "One", "Many")
  • Returns "One"
Switch(2, 0, "None", 1, "One", "Many")
  • Returns Null