IFS

Receives multiple conditions and values, and returns the value matching the first condition that evaluates to TRUE.

This is helpful to avoid having to place a IF inside a IF inside a IF

Usage

IFS(condition1, value_if_true1, condition2, value_if_true2, ...)

Parameters

condition1

(Required) The first condition to evaluate

value_if_true1

(Required) The value to use if condition1 evaluates to TRUE

condition2

(Required) The second condition to evaluate

value_if_true2

(Required) The value to use if condition2 evaluates to TRUE (and condition1 evaluates to FALSE)

...

You can provide as many conditions and values as you want. Each condition must be followed by its value_if_true.

Examples

Example With these variables Result

IFS(country = “Canada”, “a Canadian”, country = “Belgium”, “a Belgian”)

country is "Canada"

“a Canadian”

IFS(country = “Canada”, “a Canadian”, country = “Belgium”, “a Belgian”)

country is "Belgium"

“a Belgian”

IFS(country = “Canada”, “a Canadian”, country = “Belgium”, “a Belgian”)

country is "France"

ERROR

IFS(country = “Canada”, “a Canadian”, country = “Belgium”, “a Belgian”, TRUE, “a person”)

country is "France"

“a person”

More information

If none of the conditions are TRUE then the IFS function will report an error. This is to avoid generating empty content if a case was forgotten.

If instead you want a default value for when none of the conditions are TRUE, then add a final condition of TRUE and specify the default value. This behaves like the if_false parameter of the IF function.
Here is an example: IFS(val = 1, "one", val = 2, "two", TRUE, ""). Here, an empty text "" is the default value.

See also