IF

Checks the value of an expression and returns a specified value if the expression is true, and returns a different value if not.

Syntax

=IF(expr, resultTrue, resultFalse)

Arguments

ArgumentTypeDescription
exprBooleanThe expression to evaluate when determining which value to return
resultTrueAnyThe value to return if the expression evaluates to true
resultFalseAnyThe value to return if the expression evaluates to false

Examples

=IF(10 < 20, "Yes", "No")"Yes"
Checks if 10 is less than 20 and returns "Yes" if so, and "No" otherwise. Because 10 is less than 20, "Yes" is returned.

=IF(10 > 20, "Yes", "No")"No"
Checks if 10 is greater than 20 and returns "Yes" if so, and "No" otherwise. Because 10 is not greater than 20, "No" is returned.

=IF(@"Property 1" = 1, "A", "B")"A"
Checks if the shape data property "Property 1" is equal to 1 and returns "A" if so, and "B" otherwise. Because "Property 1" is equal to 1, the function returns "A".