Skip to main content
Workday User Guide
Last Updated: 2023-06-23
SWITCH

SWITCH

Description

Evaluates an expression against the match values. You can include multiple sets of match values and return values. The function returns a result corresponding to the first matched argument. You can specify a default value to return if the function doesn't find a match; otherwise, the function returns the #N/A error.

Syntax

SWITCH(
expression
,
value1
,
result1
, [
value2
,
result2
, ...], [
default
])
  • expression
    : The value, such as a number, date, or text, to evaluate against the match values.
  • value1
    : Value to compare to the expression.
  • result1
    : Value to return if the match value matches the expression.
  • value2
    : Value to compare for a possible match.
  • result2
    : Value to return if the match value matches the expression.
  • default
    : Value to return if the function doesn't find a match.