For those using Excel 2003 or earlier versions, only COUNTIF, which is designed to count the number of cells in a range that meets a single criterion, is available.
Rather than trying to figure out a way to count multiple criteria using COUNTIF, the SUMPRODUCT function can be used to instead.
As with COUNTIFS in Excel 2007, 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.
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.
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.
Example Using Excel 2003's SUMPRODUCT Function to Count Multiple Criteria:
Note: Since this is a non-standard use for the SUMPRODUCT Function, the function cannot be entered using the dialog box, but must be typed into the target cell.
- Enter the following data into cells E1 to E6: 1, 2, 1, 2, 2, 8.
- Enter the following data into cells F1 to F6: 4, 4, 6, 4, 4, 1.
- Enter the following data into cells G1 to G6: 5, 1, 5, 3, 8, 7.
- Type the heading SUMPRODUCT: into cell H1.
- Click on cell I1 - the location where the function results will be displayed.
- Type the following into cell I1:
= sumproduct ((E1:E6<=2)*(F1:F6=4)*(G1:G6>=5)) and press the ENTER key on the keyboard.
- The answer 2 should appear in cell I1 since there are only two rows (rows 1 and 5) that meet all three of the criteria listed above.
- The complete function = SUMPRODUCT ((E1:E6<=2)*(F1:F6=4)*(G1:G6>=5)) appears in the formula bar above the worksheet when you click on cell I1.