The data represents drinks purchased by five people on different days.

Note that most people appear more than once in the data.

Also, note that we are using names as a unique identifier for convenience only.

Excel formula: If this AND that

Normally, data like this will include some sort of unique ID for each person.

Essentially, we want to count rows where a given name appears with “coffee”.

COUNTIFS won’t return TRUE and FALSE, but rather a number that represents a count.

Excel COUNTIFS function

When supplied conditions are met, the result will be a non-zero number.

This is a global test applied with all data considered.

Tea

To verify if a person has ever purchased tea, we use the same approach.

Excel IF function

More than one condition can be tested by nesting IF functions.