Quick, clean, and to the point

SUMPRODUCT count multiple OR criteria

Excel formula: SUMPRODUCT count multiple OR criteria
Generic formula 

To count matching rows with multiple OR criteria, you can use a formula based on the SUMPRODUCT function. In the example shown, the formula in F10 is:


This formula returns a count of rows where column one is A or B and column two is X, Y, or Z.


Working from the inside out, each criteria is applied with a separate ISNUMBER + MATCH construction. To generate a count of rows in column one where the value is A or B we use:


MATCH generates a result array that looks like this:


and ISNUMBER converts this array to this array:


To generate a count of rows in column two where the value is X, Y, or Z we use:


Then MATCH returns:


and ISNUMBER converts to:


These two arrays are multiplied together inside SUMPRODUCT, which automatically converts TRUE FALSE values to 1 and 0 as part of the math operation.

So, to visualize, the final result is derived like this:


With cell references

The example above uses hardcoded array constants, but you can also use cell references:


More criteria

This approach can be "scaled up" to handle more criteria. You can see an example in this formula challenge.

Dave Bruns

Excel Formula Training

Formulas are the key to getting things done in Excel. In this accelerated training, you'll learn how to use formulas to manipulate text, work with dates and times, lookup values with VLOOKUP and INDEX & MATCH, count and sum with criteria, dynamically rank values, and create dynamic ranges. You'll also learn how to troubleshoot, trace errors, and fix problems. Instant access. See details here.

Download 100+ Important Excel Functions

Get over 100 Excel Functions you should know in one handy PDF.