Which function can be used to count the number of cells with multiple conditions?

Which function can be used to count the number of cells with multiple conditions?

COUNTIF Function with Multiple Criteria (Table of Contents)

  • COUNTIF with Multiple Criteria
  • COUNTIF Formula with Multiple Criteria
  • How to Use COUNTIF Function with Multiple Criteria?

Countif function in excel is used to count the cell numbers in any given range and specifying the criteria. But what if we have multiple criteria to be counted in the same set of data. This can be done when we use one CountIf function with another one separated by a plus sign. Plus, sign this allows us to use multiple CountIf functions in any way. Also, we use multiple criteria in a single Countif function in curly brackets separated by commas.

There can be two ways for multiple counting:

  1. COUNTIF Function with multiple criteria in the same column.
  2. COUNTIF Function with multiple criteria in multiple columns.

COUNTIF Formula with Multiple Criteria

Below is the COUNTIF Formula :

Which function can be used to count the number of cells with multiple conditions?

The COUNTIF Formula has two arguments, i.e. range, criteria.

  • Range: The range of cells to count.
  • Criteria: This defines the condition that tells the function of which cells to count. It can be a number, text string, cell reference, or expression.

Here in this article, we will discuss the COUNTIF Function with multiple criteria in the same column.

As we know, the COUNTIF function is a built-in function in excel, and it falls under the FORMULAS tab. Thus, the COUNTIF function can be entered in a cell-like below screenshot:

Which function can be used to count the number of cells with multiple conditions?

How to Use COUNTIF Function with Multiple Criteria?

It is very simple and easy to use. Let us understand the working of the COUNTIF Function by some COUNTIF Formula example.

Example #1

We have given some product list:

Which function can be used to count the number of cells with multiple conditions?

We need to find out the count of Laptop & Mobile. As these products are in the same column, hence we will use the COUNTIF function here.

We have given two conditions; hence the COUNTIF formula will apply as follows:

= COUNTIF(range, criteria1) + COUNTIF(range, criteria2) + …….

Please refer to the below screenshot:

Which function can be used to count the number of cells with multiple conditions?

Explanation:

  • Here, we will apply the condition one by one. First will take the range and 1st condition under COUNTIF function. Again will take the same range and 2nd condition under COUNTIF function and so on…
  • After applying all the given conditions, sum up all the results to find out the final conclusion.

The final result is:

Which function can be used to count the number of cells with multiple conditions?

Example #2

We have given some product details here. In this example, we will use a COUNTIF function between two numbers.

Which function can be used to count the number of cells with multiple conditions?

Here we will calculate the count of items which is greater than 12 and less than 30.

The COUNTIF formula will apply as follows:

=COUNTIF( $C$19:$C$30, “>12”) + COUNTIF($C$19:$C$30, “<30”)

Please refer to the below screenshot:

Which function can be used to count the number of cells with multiple conditions?

Explanation:

  • We pass the condition one by one and, in the end, sum all the results.

Hence the final result is:

Which function can be used to count the number of cells with multiple conditions?

Example #3

Let’s take the same product details again.

Which function can be used to count the number of cells with multiple conditions?

Here, we will calculate the sum of products who sold out in the month of Jan, Feb & May.

We will apply the COUNTIF formula as follows:

=COUNTIF($D$40: $D$51, “Jan”) + COUNTIF( $D$40:$D$51,”Feb”) + COUNTIF( $D$40:$D$51, “May”)

Which function can be used to count the number of cells with multiple conditions?

Explanation:

  • First, we will select the range of cells from D40:D51 and will pass 1st condition, “Jan”.
  • Second, we will again select the range of cells from D40:D51 and will pass the 2nd condition, “Feb”.
  • A third will again select the range of cells from D40:D51 and will pass the 3rd condition, “May”.
  • After passing all the conditions one by one, in the end, add all the results.

The Final Result is:

Which function can be used to count the number of cells with multiple conditions?

Things to Remember

  • First, analyze the problem and condition mentioned.
  • If the conditions are related to one specific column, we will apply the COUNTIF function in a single column, as discussed in the above article.
  • If conditions are related to multiple columns, then we use the COUNTIFS function, which we will discuss in the later article.

This has been a guide to COUNTIF with Multiple Criteria. Here we discuss the COUNTIF Formula with Multiple Criteria and how to use the COUNTIF Function along with practical examples and downloadable excel template. You can also go through our other suggested articles –

  1. COUNTIFS in Excel
  2. COUNTIF Examples in Excel
  3. COUNTIF Formula in Excel
  4. COUNTA Function in Excel

Which function is used to find the number of cells with multiple specified conditions?

This formula uses COUNTIF twice to specify multiple criteria, one criteria per expression. You could also use the COUNTIFS function. Counts the number of cells with a value greater than 55 in cells B2 through B5. The result is 2.

Can you use Countif with multiple criteria?

You can use the COUNTIFS function in Excel to count cells in a single range with a single condition as well as in multiple ranges with multiple conditions. If the latter, only those cells that meet all of the specified conditions are counted.

What is Countif function in Excel?

The Microsoft Excel COUNTIF function counts the number of cells in a range, that meets a given criteria. The COUNTIF function is a built-in function in Excel that is categorized as a Statistical Function.

What function is used to count conditions?

To count numbers or dates that meet a single condition (such as equal to, greater than, less than, greater than or equal to, or less than or equal to), use the COUNTIF function.