This means we are working with scenario 2 above.

With COUNTIFS

You might at first reach for theCOUNTIFS function, which handles multiple criteria natively.

This works, but you might see this is a somewhat complicated and redundant formula.

How color logic is evaluated in this formula

(If you need a primer on Boolean algebra,this video provides an introduction.)

This is the count of rows where group = “a” ANDColor1ORColor2are “red”.

To avoid double counting

We don’t want to double count rows where bothColor1andColor2are “red”.

How color logic is evaluated in this formula

How color logic is evaluated in this formula

How color logic is evaluated in this formula

How color logic is evaluated in this formula

FILTER rows with OR logic

Excel formula: Count rows with multiple OR criteria

Excel formula: Count cells equal to this or that

Excel formula: Count cells not equal to x or y

Excel formula: Count cells that contain either x or y

Excel formula: COUNTIFS with multiple criteria and OR logic

Excel formula: SUMPRODUCT count multiple OR criteria

Excel SUMPRODUCT function

Article image