IF

The IF function returns one value if a condition is true and another value if it is false.

Syntax

IF( logical_test, value_if_true, value_if_false )

Arguments

  • logical_test: The condition to evaluate.

  • value_if_true: The value returned if the condition is true.

  • value_if_false: The value returned if the condition is false.

Return value

Returns either value_if_true or value_if_false based on the result of the condition.

Example

IF(PY > 0, (AC - PY) / PY, 0)

Returns (AC - PY) / PY if PY is greater than 0; otherwise, returns 0.

Excel equivalent

IFarrow-up-right

Last updated

Was this helpful?