Counting Multiple Ranges with COUNTIF in Google Sheets

Video google sheet countif multiple conditions

In Google Sheets, the COUNTIF function is commonly used to count the number of cells within a range that meet a single criteria. But what if you want to count cells in multiple ranges with multiple criteria? That’s where a combination of functions like COUNTIF, SUMPRODUCT, or an array formula comes in handy.

Using COUNTIF with an Array Formula

If you have multiple ranges and want to count cells that meet the same criteria across those ranges, you can use an array formula with COUNTIF.

Here’s an example:

=SUM(COUNTIF({range1, range2, range3}, criteria))
  • range1, range2, range3: These are the ranges you want to count.
  • criteria: This is the condition that cells must meet.

Enclose the ranges in curly brackets {} to create an array and use SUM to add up the results from each range.

Using SUMPRODUCT for Multiple Criteria

If you have different criteria for different ranges, you can use SUMPRODUCT.

=SUMPRODUCT(COUNTIF(range1, criteria1), COUNTIF(range2, criteria2), ...)
  • range1, range2, ...: Different ranges to count.
  • criteria1, criteria2, ...: Different criteria for each range.

This method multiplies the count for each range-criteria pair and sums them up. It is versatile for more complex criteria and multiple ranges.

How to Use COUNTIF with Multiple Ranges

Follow these simple steps to use the COUNTIF and SUMPRODUCT functions to count items in multiple ranges with different criteria.

1. Choose the Cells to Count (Identify the Ranges)

Identify the specific columns or cells you want to include in your count. Let’s assume you want to count occurrences of “Apple” in column A (A1:A10) and “Orange” in column B (B1:B10) for this tutorial.

2. Select the Destination Cell for the Count Result

Click on the cell in your Google Sheets where you want to display the result of your count. This cell will show the total count of the ranges you have selected.

3. Enter COUNTIF for a Single Criteria

In the selected cell, enter the COUNTIF formula for a single criteria across multiple ranges. Use the following formula format:

=SUM(COUNTIF({range1, range2}, "criteria"))

For example, to count how many times “Apple” appears in both column A and column B, enter =SUM(COUNTIF({A1:A10, B1:B10}, "Apple")).

4. Use SUMPRODUCT for Different Criteria in Each Range

If you have different criteria for different ranges, use the SUMPRODUCT function. In the selected cell, type:

=SUMPRODUCT(COUNTIF(range1, criteria1), COUNTIF(range2, criteria2))

For example, to count “Apple” in column A and “Orange” in column B, type '=SUMPRODUCT(COUNTIF(A1:A10, "Apple"), COUNTIF(B1:B10, "Orange"))'.

5. Specify Criteria for Each Range in the Formula

In the formula, specify the specific criteria for each range. For instance, if your criteria are “Apple” for range A1:A10 and “Orange” for range B1:B10, make sure to enter them correctly in your formula.

6. Finalize the Formula and Press Enter

After entering your formula, press Enter on your keyboard. Google Sheets will process the formula and display the count based on the specified ranges and criteria. For example, it will show the total number of “Apple” occurrences in column A and “Orange” occurrences in column B.

7. Modify Ranges or Criteria for Different Counts

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 you now have a better understanding of how to set up COUNTIF with multiple ranges in Google Sheets. Feel free to use our text automation software to easily set up personalized reminders from your spreadsheet with just a few clicks.

If you enjoyed this article, you might also like our article on setting up the COUNTIF function with contains in Google Sheets or our article on configuring COUNTIF in Google Sheets.

If you want to learn how to create an email list in Google Sheets, we also suggest checking out our comprehensive guide.

For more tips and tricks on Google Sheets, visit Crawlan.com.

Related posts