IF

Returns one of two values depending on a condition.

Syntax:

IF(condition:Boolean, then-expression, else-expression)

If the value of condition is TRUE (or any non-zero number), the IF function evaluates and returns then-expression; otherwise it evaluates and returns else-expression.

Example:

IF(A1=3, "A1 is 3", "A1 is not 3")

returns "A1 is 3" if the condition A1=3 is true.

IF functions can be nested; for example;

IF(A1=3, "A1 is 3", IF(B1=3, "A1 is not 3 but B1 is", "Neither cell is 3"))