IF
The IF function checks a condition and returns one value when it is TRUE; otherwise, it returns a second value.
Syntax
IF(logical_test,value_if_true,value_if_false)
Arguments
logical_test – Any value or expression that can be evaluated as TRUE or FALSE.
value_if_true – The value to be returned if the logical test is TRUE.
value_if_false – The value to be returned if the logical test is FALSE.
Return value
The return value can be either value_if_true or value_if_false.
Example 1
IF(PY > 0,(AC-PY)/PY,0)
The above formula returns (AC-PY)/PY if the PY value is greater than 0; otherwise, it returns 0.
Excel equivalent
Last updated