AND (&&)

The following section describes the syntax and usage of the AND (&&) function in ActivityInfo.

Description

The AND (&&) function is used to determine whether two conditions in a test are true. 

Multiple AND functions can be chained together to test whether a set of more than two conditions are true.

Syntax

condition1 && condition2

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

The condition must evaluate to TRUE or FALSE.
condition2 Yes The second condition you wish to test.

The condition must evaluate to TRUE or FALSE.

Result

  • TRUE if both conditions evaluate to TRUE.
  • FALSE if one or both conditions evaluate to FALSE.
  • NA if either condition is not a logical value (TRUE/FALSE).

Example

1. Basic Use

We will be using the AND function to evaluate two conditions, and using the IF function to return a value.

Arguments

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

Formula

IF(VAC.Measles && VAC.Mumps,1,0)

Results

2. Multiple Conditions

We will be using the AND function to evaluate a set of three conditions, and using the IF function to return a value.

Arguments

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

Formula

IF(VAC.Measles && VAC.Mumps && VAC.Rubella,1,0)

Results