IIF Function

The IIF function evaluates a condition and returns either the true or false expression. One value is returned if the condition is true, and a different value is returned if the condition is false.

Syntax

IIF(condition,true expression,<false expression>)

The false expression is optional. If a false expression is not supplied, the default is Null. The true expression can be an integer, date or string, but the false expression must agree with it.

Example

IIF(c3>0,c3,0)

If c3 is greater than zero, then the cell will equal c3. However, if c3 is equal to or less than zero, the cell will be set to zero.

Related Topics