Skip to main content

AND

The AND function is a logical function that performs a boolean AND operation on a variable number of nullable boolean values. The params keyword allows the function to accept a variable number of arguments, which are passed to the function as an array.

Returns true if the list of conditions are true, false if one or more is false, and null if any of the input values is null.

Syntax

bool? AND(params bool?[] conditions)

Examples

Some basic logical examples are:

AND(true, false, true)

Will return false

AND(null, true, false)

Will return null

AND(true, true, true)

Will return true


You can combine the AND function with other functions such as COMPARE:

AND(COMPARE("Apples","Oranges"))

This will return false as the COMPARE returns false.

or

AND(COMPARE("Apples", "apples", true))

Which will return true as the COMPARE returns true as "Apples" is the same as "apples" when the case is ignored.

You can then apply this principle to use your column data instead of defined strings.

You may want to compare two columns to see if they are the same, for example a Status column being compared to a WorkflowStatus column:

AND(COMPARE(Status, WorkflowStatus))

Or you may want to compare a column to a specific string value, such as an employee status column Status to the string value Employed

AND(COMPARE(Status, "Employed"))

If you want this to be case sensitive you can add in false to not ignore case, by default COMPARE will ignore case.