Returns the result corresponding to the first matching value.


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 matches , the following is returned.

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

case 2+, result 2+ (optional): Several 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 condition is supplied, a Null result is returned when no cases are met.


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

See Also