Use Excel's SUMPRODUCT Function to Count Multiple Criteria

Advanced calculator detail

Mario Gutiérrez / Getty Images

The COUNTIFS function, which can be used to count up the number of times data in two or more ranges of cells meets multiple criteria was first introduced in Excel 2007. Prior to that, only COUNTIF, which is designed to count the number of cells in a range that meets a single criterion, was available.

For those using Excel 2003 or earlier, or for those wanting an alternative to COUNTIFS, rather than trying to figure out a way to count multiple criteria using COUNTIF, the SUMPRODUCT function can be used instead.

As with COUNTIFS, the ranges used with SUMPRODUCT must be of identical size. Further, the function only counts instances where the criterion for each range is met simultaneously — such as in the same row.

How to use the SUMPRODUCT Function

The syntax used for the SUMPRODUCT function when it is being used to count multiple criteria is different than normally used by the function:

=SUMPRODUCT( Criteria_range-1, Criteria-1) * (Criteria_range-2, Criteria-2) * ...)
  • Criteria_range: The group of cells the function is to search.
  • Criteria: Determines whether the cell is to be counted or not.
Screenshot of Excel showing the SUMPRODUCT syntax

In the example below, we will count only the rows in the data sample E1 to G6 that meet specified criteria for all three columns of data. The rows will only be counted if they meet the following criteria:

  • Column E: If the number is less than or equal to 2.
  • Column F: If the number is equal to 4.
  • Column G: If the number is greater than or equal to 5.

Using Excel's SUMPRODUCT Function 

Since this is a non-standard use of the SUMPRODUCT Function, the function cannot be entered using the Formula Builder, but must be typed into the target cell.

  1. Enter the example data, as shown in the screenshot provided above, into your Excel spreadsheet.

  2. Click on cell F8 — the location where the function results will be displayed.

  3. Type the following into cell F8:


    and press the Enter key on the keyboard.

  4. The answer 2 should appear in cell F8 since there are only two rows (rows 1 and 5) that meet all three of the criteria listed above.

    Screenshot of Excel showing the function result

The complete function appears in the formula bar above the worksheet when you click on cell F8.