When you use Excel for data analysis jobs, COUNTIF with Multiple Criteria can be your daily buddy to help you. Because this complex yet flexible formula counts the number of cells when you impose rules and conditions. In many cases, the criteria can be like simple expression or comparison operator. However, there are scenarios where we need multiple criteria to work simultaneously.
Table of Contents
What is Countif? Learning excel countif multiple criteria
Countif is an Excel function will count the cells in a range if they meet your certain condition. The syntax for Countif is simple like below thing.
=COUNTIF(range, criteria)
Where range
is the all cells that we want to count. While criteria
is the condition we want to apply.
countif multiple conditions
For example, in case you have a list of numbers in cells A1 to A10. And we want to count cells that are greater than 5. We can use the following Countif formula.
=COUNTIF(A1:A10, ">5")
This will give us the number in range A1 to A10 that are greater than 5.
Using COUNTIF with Multiple Criteria
What if we want to count cells that meet multiple criteria? For example, let’s say we have a table with columns for Product, Region and Sales. We want to count the number of sales for a specific product in a specific region.
If you wanna do it, we can use the COUNTIFS function. Because it can specify multiple criteria. The syntax for COUNTIFS when you have multiple condition is below.
=COUNTIFS(criteria_range1, criteria1, [criteria_range2], [criteria2], ...)
Syntax Breakdown
criteria_range1
: The range we want to apply the first criteria to.criteria1
: The criteria we want to use to count cells incriteria_range1
.[criteria_range2]
: This is Optional. You can choose another cell group to apply the second criteria to.[criteria2]
: Again, this is optional if we have criteria we want to use to count cells incriteria_range2
.
We can add as many criteria_range
and criteria
pairs.
Using COUNTIFS in Practice
Let’s use the example of counting sales for a specific product in a specific region. We have a table with columns A, B and C. The table is containing data on products, regions and sales, respectively. We want to count the number of sales for the product “Widget” in the region “East.”
=COUNTIFS(A:A, "Widget", B:B, "East")
This formula counts cells in column C that meet the criteria “Widget” in column A and East in column B.
We can add more criteria pairs if we need. For example, if we wanted to count the number of sales for the product Widget in the region East. And those will be greater than 1000.
=COUNTIFS(A:A, "Widget", B:B, "East", C:C, ">1000")
This formula counts the cells in column C that meet all three criteria. If we summarize, these 3 criteria are Widget in column A, Eas in column B and a value greater than 1000 in column C.
countifs function in excel with multiple criteria: countif 2 conditions
Countif can also work to count the number of cells meeting multiple criteria simultaneously. If we wanna do this, we can use the following syntax.
In this syntax, criteria_range1
is the first range we check and criteria1
is the first criteria that we want to apply. We can add more criteria by adding additional pairs of criteria_range
and criteria
.For example, we can look at the same example with Product, Region and Sales Amount. We want to count the number of sales. Here, the Product is Widget and the Region is either East or West. We can use the following Countifs formula:
=COUNTIFS(A2:A10, "Widget", B2:B10, {"East","West"})
This will count sales where that meet all of above conditions you write in formula.
Using Wildcards with countif with multiple conditions
Countif can also operate even if you use wildcard characters to count cells to match a pattern. The asterisk (*) can match any number of characters. While the question mark (?) can be match any single character.
For example, let’s say we have a list of names. And we want to count the names that start with the letter J. We can use the following Countif formula:
=COUNTIF(A1:A10, "J*")
This will count names in the range A1 to A10 that start with the letter J.
Conclusion on multiple countif conditions
Countif is a powerful function in Excel. And as we saw in above examples, you can complex your formula adding 2 or 3 conditions. When you set up your formula correctly, you can even add up to 127 conditions in one single command.
How to Countif Multiple Criteria?
When we need to count cells in line with multiple criteria simultaneously, we can use the Countifs function. In this case, wildcard characters with Countif can count cells to find a pattern. When you apply these techniques, you will definitely can save time when working with data in Excel.
For more excel related topics, you can check our most valuable resources here. Countifs formula is a great start for advancing your knowledge in Excel miracles. When you got it, you can look at applying macros for example.
FAQs
Can we say the Countif work with dates?
Of course it can work with dates. But here, you should specify the date in the criteria argument. And another important point using the appropriate date format.
Q2. How many criteria to apply with Countifs?
A2. Countifs can handle up to 127 criteria pairs.
Hello, I’m Cansu, a professional dedicated to creating Excel tutorials, specifically catering to the needs of B2B professionals. With a passion for data analysis and a deep understanding of Microsoft Excel, I have built a reputation for providing comprehensive and user-friendly tutorials that empower businesses to harness the full potential of this powerful software.
I have always been fascinated by the intricate world of numbers and the ability of Excel to transform raw data into meaningful insights. Throughout my career, I have honed my data manipulation, visualization, and automation skills, enabling me to streamline complex processes and drive efficiency in various industries.
As a B2B specialist, I recognize the unique challenges that professionals face when managing and analyzing large volumes of data. With this understanding, I create tutorials tailored to businesses’ specific needs, offering practical solutions to enhance productivity, improve decision-making, and optimize workflows.
My tutorials cover various topics, including advanced formulas and functions, data modeling, pivot tables, macros, and data visualization techniques. I strive to explain complex concepts in a clear and accessible manner, ensuring that even those with limited Excel experience can grasp the concepts and apply them effectively in their work.
In addition to my tutorial work, I actively engage with the Excel community through workshops, webinars, and online forums. I believe in the power of knowledge sharing and collaborative learning, and I am committed to helping professionals unlock their full potential by mastering Excel.
With a strong track record of success and a growing community of satisfied learners, I continue to expand my repertoire of Excel tutorials, keeping up with the latest advancements and features in the software. I aim to empower businesses with the skills and tools they need to thrive in today’s data-driven world.
Suppose you are a B2B professional looking to enhance your Excel skills or a business seeking to improve data management practices. In that case, I invite you to join me on this journey of exploration and mastery. Let’s unlock the true potential of Excel together!
https://www.linkedin.com/in/cansuaydinim/