Help: If Function

IF(C,X,Y) produces X if the condition C is true, Y if it is false. C is a "boolean expression": it can be an equality or inequality (of the forms A=B, A<=B, A=B, A>B), or built up from these using the logical operators OR, AND and NOT.

In a boolean expression using logical operators, the equalities and inequalities must be in parentheses. NOT takes precedence over AND, which takes precedence over OR. For example, the expression
(A > B) or not(C > D) and (E > F)
is interpreted as
(A > B) or ((not(C > D)) and (E > F))
If in doubt, use parentheses.

Because of roundoff error, you should avoid using A = B if A or B involves non-integers.
Max function
Min function
Mathematical formulas
Help index