IF specifies a logical test to be performed.

## Syntax

IF(`test`,`then
value`,`otherwise value`)

`test` is any value or expression that can be
TRUE or FALSE.
`then value` (optional) is the value that is
returned if the logical test is TRUE.
`otherwise value` (optional) is the value that
is returned if the logical test is FALSE.

In IBM Docs functions, parameters marked as optional can be
left out only when no parameter follows. For example, in a function
with four parameters, where the last two parameters are optional,
you can leave out parameter 4 or parameters 3 and 4. However, you
cannot leave out parameter 3 alone.

## Example

`=IF(A1>5,100,"too small")`

If
the value in A1 is higher than 5, the value 100 is entered in the
current cell; otherwise, the text "too small" (without quotes) is
entered.