IF

The following section describes the syntax and usage of the IF function in ActivityInfo.

Description

The IF function is used to return a certain value if a specified condition is true, and return another value if the condition is false.

Syntax

IF(condition, trueReturn, falseReturn)

Argument Required Description
condition Yes The condition you wish to test.

The condition must evaluate to TRUE or FALSE.
trueReturn Yes The value you wish to return if the condition is true.
falseReturn Yes The value you wish to return if the condition is false.

Result

  • The trueReturn value if the condition evaluates to TRUE.
  • The falseReturn value if the condition evaluates to FALSE.
  • NA if the condition is not a logical value (TRUE/FALSE).
  • #VALUE! if all required arguments have not been provided.

Example

We will be using the IF function to evaluate a condition and return different values for a TRUE and FALSE case.

Arguments

We will be using the Multiple Selection Field "Against what have you been vaccinated?" with Field code "VAC".

Formula

IF(VAC.Measles,1,0)

Results