In Google Sheets, the COUNTIF function is typically used to count the number of cells within a range that meet a single criterion. However, if you want to count cells across multiple ranges with multiple criteria, you'll need to use a combination of functions like COUNTIF, SUMPRODUCT, or an array formula.
If you have multiple ranges and you want to count cells that meet the same criterion across these ranges, you can use an array formula with COUNTIF.
Here's an example:
=SUM(COUNTIF({range1, range2, range3}, criterion))
Wrap the ranges in curly braces {} to create an array and SUM to add up the counts from each range.
If you have different criteria for different ranges, you can use SUMPRODUCT:
=SUMPRODUCT(COUNTIF(range1, criterion1), COUNTIF(range2, criterion2), ...)
This method multiplies the count of each range-criterion pair and sums them up. It's versatile for more complex criteria and multiple ranges.
Follow the simple steps below to use the COUNTIF and SUMPRODUCT functions to count items across multiple ranges and with different criteria.
Identify the specific columns or cells that you want to include in your count. For our tutorial, assume you're interested in counting occurrences of "Apple" in column A (A1:A10) and "Orange" in column B (B1:B10).
Click on the cell in your Google Sheets where you want the result of your count to be displayed. This cell will show the final count number from the ranges you've selected.
In the selected cell, type the COUNTIF formula for a single criterion across multiple ranges. Use the formula format =SUM(COUNTIF({range1, range2}, "criteria")). For example, to count how many times "Apple" appears in both Column A and Column B, type =SUM(COUNTIF({A1:A10, B1:B10}, "Apple")).
If you have different criteria for different ranges, use the SUMPRODUCT function. In the selected cell, type =SUMPRODUCT(COUNTIF(range1, criterion1), COUNTIF(range2, criterion2)). For instance, to count "Apple" in column A and "Orange" in column B, type '=SUMPRODUCT(COUNTIF(A1:A10, "Apple"), COUNTIF(B1:B10, "Orange"))'.
Within the formula, specify the exact criteria for each range. For example, if your criteria are "Apple" for range A1:A10 and "Orange" for range B1:B10, make sure these are correctly entered in your formula.
After you have entered your formula, press Enter on your keyboard. Google Sheets will process the formula and display the count based on your specified ranges and criteria. For example, it will show the combined total of "Apple" occurrences in column A and "Orange" occurrences in column B.
If you need to count different items or use different ranges, simply modify the ranges or criteria in the formula. After making your changes, press Enter to update the count. This allows for flexible counting based on your specific data needs.
We hope that you now have a better understanding of how to set up Google Sheets COUNTIF Multiple Ranges.
If you enjoyed this article, you might also like our article on how to set up Google Sheets COUNT IF contains function or our article on how to set up the COUNTIF function in Google Sheets.
If you want to learn how to create an email list in Google Sheets, we also suggest checking out our detailed guide.