Count a Column With Multiple Conditions in Google Sheets

Published on

How to count the occurrences of few items in a list of items in Google Sheets. It’s easy with Countif. Use Countif to count a column with multiple conditions in Google Doc Sheets.

As a side note, if you are looking for different options to perform count in Google Sheets like count, logical count (Countif, Countifs etc.) and database count (Dcount) check my Count function tutorial.

Back to count a list with multiple criteria in Google Sheets. I am using a simple Countif Array formula for this. Though the formula may return individual counts of each item we can sum that using the basic math function Sum or Sumproduct.

If you use Sumproduct together with Countif, then you can skip the ArrayFormula. See that example to understand what I am talking about.

Example: List of Items in Column B and the Conditions to Count in Column E.

Count a Column With Multiple Conditions in Google Sheets

Now see the Countif formula that you can use to count column B with the multiple conditions in column E in Google Sheets.

Countif to Count a Column With Multiple Conditions in Google Sheets

I just want the count the availability of the multiple conditions in the range E3: E5 in column B list.

As famously known, to perform a conditional count across a range, the best and fast performing function is Countif.

Syntax:

COUNTIF(range, criterion)

The Countif formula below wouldn’t serve our purpose since I have used criteria, not a criterion. That means there are multiple conditions to count.

=countif(B2:B16,E3:E5)

So what to do?

Make the formula work correctly with multiple conditions or you can say criteria in an array or range. How? Wrap the Countif with the ArrayFormula which transforms a non-array formula into an array formula.

=ArrayFormula(countif(B2:B16,E3:E5))

This is enough to count a column with multiple conditions in Google Sheets. Because it returns the count of each condition separately. But additionally, use the Sum as below to get the total count.

=sum(ArrayFormula(countif(B2:B16,E3:E5)))

Result: 6

You can shorten this formula using the Sumproduct function. Instead of using ArrayFormula and Sum, you just need to use Sumproduct with Countif as below.

=sumproduct(countif(B2:B16,E3:E5))

Result: 6

You can use Countif+Sumproduct combo as above when you want to count a list with many conditions in Google Sheets. The Sumproduct itself is an ArrayFormula. So there is no requirement of the additional use of ArrayFormula.

Related Reading:

1. COUNTIF to Count by Month in a Date Range in Google Sheets.

2. Countif in an Array in Google Sheets Using Vlookup and Query Combo.

3. How to Use COUNTIF with UNIQUE in Google Sheets.

4. How to Perform a Case Sensitive COUNTIF in Google Sheets.

Prashanth KV
Prashanth KV
Your Trusted Google Sheets and Excel Guide Prashanth KV brings a wealth of experience in Google Sheets and Excel, cultivated through years of work with multinational corporations in Mumbai and Dubai. As a recognized Google Product Expert in Docs Editors, Prashanth shares his expertise through insightful blogging since 2012. Explore his blog for practical tips and guidance on maximizing your spreadsheet skills.

How to Create a Searchable Table in Excel Using the FILTER Function

Finding specific records, or rows containing the required information, is straightforward in Excel using...

Time Sequences in Excel by Minute, Hour, or Second Increments

Creating time sequences, whether by hour, minute, or second increments in Excel, can be...

Finding Most Frequent Text in Excel with Dynamic Array Formulas

Looking to identify the most frequently occurring text in Excel? You can do this...

Hierarchical Numbering Sequences in Excel

Creating hierarchical numbering sequences in an Excel spreadsheet can significantly improve the way you...

More like this

XMATCH Row by Row: Finding Values Across a Range in Google Sheets

Using the BYROW function with XMATCH in Google Sheets allows us to match values...

Limit Formula Expansion to a Specific Row in Google Sheets

In this tutorial, I’ll explain how to limit the expansion of an array formula...

3-D Referencing Structured Data Tables in Google Sheets

When you have several tables within a single sheet—not across multiple sheets in a...

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.