Calc IF function

An IF statement can have two results. The first result is if your comparison is True, the second if your comparison is False.

Help CentreFunctions & Formulas

For a full list of available calculation functions, please read What calculation functions are supported.

This article describes the formula syntax and usage of the IF function.


Description

An IF statement can have two results. The first result is if your comparison is True, the second if your comparison is False.


Syntax

IF(logical_test, value_if_true, [value_if_false])

The IF function syntax has the following arguments:

  • logical_test - Required. The condition you want to test.
  • value_if_true - Required: The value that you want returned if the result of logical_test is TRUE.
  • value_if_false - Optional: The value that you want returned if the result of logical_test is FALSE.

Example

FormulaDescriptionResult
=IF({variable} > 10, TRUE, FALSE)Tests the condition if the variable (assuming its value is 20) is larger than 10TRUE
=IF(LEN({variable})<10, "too short", "perfect")Tests the condition if the LEN of the variable (assuming its value is "Home") is shorter than 10 characterstoo short

Errors

For a full list of formula errors, please read Formula errors.


Related functions

See it working on your own data

Everything documented here ships with the platform – try the document tools free, or go live in 7 days.