AND Function

Description

If you specify multiple criteria as arguments and all specified criteria are true, it returns true; otherwise, it returns false.

Criteria can be specified one by one with arguments or as an array. If specified as an array, the second and subsequent arguments are ignored.

You can specify any number of criteria.

If no criteria are specified, true is returned.

Usage Examples

The following example returns true if the year is divisible by four and the day is 29 days in February; otherwise, it is false.

= and(year % 4 = 0, month = 2, day = 29)

The same as the above example, with an array, looks like this:

= and([year % 4 = 0, month = 2, day = 29])

The AND function can also be used as the first argument to the if function. The following example returns the string target if the country is Japan and the gender is female; otherwise, it returns the string target off.

= if(and(country = "Japan", gender = "women"), "Target", "Not Targeted")

The way you specify in an array can also be combined with destination tables and fields of type multi-select. The following example is true if the decision field value is “A” for all rows in a destination table with the field code “Table.”

= and(Table.judgment = "A")