How to Use COUNTIFS Function with Multiple Criteria in Excel?

The COUNTIF function counts cells in a range depending on a single criterion. Whereas the COUNTIFS function counts cells in one or multiple ranges depending on multiple criteria. This article discusses different uses of the COUNTIFS Function with multiple criteria such as Texts, Values, Dates, and Multiple Columns. We will go through 4 easy methods to do the task.


How to Use COUNTIFS Function with Multiple Criteria in Excel: 4 Easy Examples

The following dataset has the Order Date, Category, Product, Quantity, and Unit Price columns. Further using this dataset, we will go through 4 easy examples of using COUNTIFS with multiple criteria. Here, we used Excel 365. You can use any available Excel version.

The Dataset


1. Applying the COUNTIFS Function with Constant Array

In this method, we will use COUNTIFS with a constant array. From the dataset, the seller wants to count the Cookies, Bars, and Crackers types of food sales. In this case, using a combination of SUM and COUNTIFS can do the job.

Steps:

  • First of all, we will type the following formula in merged cell B21:C21.
=SUM(COUNTIFS($C$5:$C$18,{"Cookies","Bars","Crackers"}))

Applying SUM and COUNTIFS Functions

  • After that, press ENTER.
  • Therefore, the total number of food types will appear in the merged cell B21:C21.

Result after Using COUNTIFS with Constant Array


2. Using the COUNTIFS Function with Multiple Criteria for Different Values and Dates

In this method, we will use COUNTIFS between two values, and two dates with multiple criteria.

2.1. Employing COUNTIFS Function Between Two Values

Suppose the seller wants to count the number of sold products Quantity that exceeds the amount of 50 but below 100. In this case, COUNTIFS with multiple criteria eases the work.

Steps:

  • In the beginning, we will type the following formula in the merged cells B21:E21.
=COUNTIFS($E$5:$E$18,">50", $E$5:$E$18,"<100")

Using COUNTIFS function for Values

  • Then, hit ENTER.
  • As a result, the number of sold products quantity between 50-100 is displayed in cells B21:E21.

Output after Using COUNTIFS for Values and Dates


2.2. Using COUNTIFS Function Between Two Dates

In a scenario, the seller wants to count the sale numbers between 11/10/2021 to 15/10/2021. Operator (&) is used to direct the reference in the formula.

Steps:

  • First of all, we will type the following formula in the merged cells B21:C21.
=COUNTIFS($B$5:$B$18,">="&DATE(2021,10,10),$B$5:$B$18,"<="&DATE(2021,10,20))

 Using COUNTIFS with Multiple Criteria for Dates

  • After that, hit ENTER.
  • Therefore, the number of sales between 11 Oct to 15 Oct 2021 appears in the merged cells B21:C21.

The Output after Using COUNTIFS for Dates

Read More: How to Use COUNTIFS with Date Range and Text in Excel


3. Inserting COUNTIFS Function with Multiple Criteria in Multiple Columns

Sometimes, the seller has to count sales based on criteria that are in multiple columns. In the dataset, suppose, the seller wants to count the sales of products (Chocolate Chip) based on category (Cookies) and a specific quantity(>50).

Steps:

  • In the beginning, we will type the following formula in the merged cells D21:D22.
=COUNTIFS($C$5:$C$18,C20,D5:D18,C21,$E$5:$E$18,C22)

Inserting COUNTIFS with Multiple Criteria in Multiple Columns

  • After that, press the ENTER button.
  • Therefore, the result appears in the merged cells D21:D22.

The result after Using COUNTIFS for Multiple Columns

Read More: How to Use COUNTIFS to Count Across Multiple Columns in Excel


 4. Using the COUNTIFS Function with Wildcard Characters

In a situation when the seller needs to count the products that are out of stock, he can use Wildcard Characters such as “*”, “?” etc. In a scenario, where the seller has a couple of products out of stock like the image below.

Dataset for Wildcard Character

Steps:

  • First, we will type the following formula in the merged cells B21:D21.
=COUNTIFS($D$5:$D$18,"*",$G$5:$G$18,"<>"&"")

 Using COUNTIFS with Wildcard Characters

  • Afterward, press the ENTER button.
  • Hence, the count of products that are out of stock appears in the merged cells B21:D21.

The Outcome After Using Wildcard Characters

Note: Keep it in mind that wildcard characters (“*”, “?” etc.) can not be used in 2nd criterion.

Practice Section

You can download the Excel file and practice the explained methods.

Practice Section


Download Practice Workbook

You can download the Excel file from the following link and practice while reading this article.


Conclusion

Here, we show you 4 easy examples of using the COUNTIFS function with multiple criteria in Excel. Thank you for reading this article. We hope it was helpful. If you have any queries, please let us know in the comment section.


Excel COUNTIFS Multiple Criteria: Knowledge Hub


<< Go Back to Excel COUNTIFS Function | Excel Functions | Learn Excel

Get FREE Advanced Excel Exercises with Solutions!
Maruf Islam
Maruf Islam

MARUF ISLAM is an excellent marine engineer who loves working with Excel and diving into VBA programming. For him, programming is like a superhero tool that saves time when dealing with data, files, and the internet. His skills go beyond the basics, including ABACUS, AutoCAD, Rhinoceros, Maxsurf, and Hydromax. He got his B.Sc in Naval Architecture & Marine Engineering from BUET, and now he's switched gears, working as a content developer. In this role, he creates techy content... Read Full Bio

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo