Skip to content

IF

Returns one value when a condition is met, and a different value when it’s not.

Function syntax

IF(logical_test, value_if_true, value_if_false)

Arguments:

  • logical_test: The condition to evaluate.
  • value_if_true: The value returned when the condition is TRUE.
  • value_if_false: The value returned when the condition is FALSE.

Examples

  • IF(A5>B5, “yes”, “no”) - Returns “yes” or “no” depending on the values in A5 and B5.
  • IF(SUM(revenue{})>SUM(cost{}), “Profitable”, “Not profitable”) - Returns “Profitable” or “Not profitable” depending on the outcome.