Returns the value following the first condition that is met.
If(condition 1, value 1, [condition 2], [value 2],..., [else])
If Condition 1 is True, Value 1 is returned. If Condition 2 is True, Value 2 is returned. If all conditions are false, the Else value listed last in the function is applied.
condition 1 (required) Logical condition that returns a result that is either True or False. If the condition is True, the function returns the following value. Note: you can use operators in conditions.
value 1 (required) The value to be returned if its preceding condition is True.
condition 2+, value 2+ (optional) Several , pairs can be listed in a single function. Every supplied condition must have a corresponding value.
else (optional) The value to be returned if no conditionals evaluate as True. If no condition is supplied, a Null result is returned when no conditions are met.
If([size] < 3, "small", [size] < 6, "medium", "large")
- Assign “small” to sizes less than 3, “medium” to sizes less than 6, and “large” to all other sizes.
If([revenue] - [cost] > 0, "profit", "loss")
- Categorize a record as a profit or a loss based on revenue and cost.
If([Product Family] = "Cameras & Camcorders" OR [Product Family] = "Camera Accessories", "Photography")
- Categorize records in the product family with an overarching product type using the "OR" operator.