## Count cells that match two or more criteria in Excel

In Excel, to count the number of cells based on two or multiple criteria, the COUNTIFS function may help you to solve this task quickly and easily.

Supposing, you have a product list as below screenshot shown, now, you want to count the number of the product T-shirt which Qty is greater than 30, this article will talk about how to use the COUNTIFS function for dealing with this job in Excel.

Count cells that match two or more criteria with COUNTIFS function

#### Count cells that match two or more criteria with COUNTIFS function

Normally, the COUNTIFS function helps to return the number of cells that meet one or more criteria, the generic syntax is:

=COUNTIFS(criteria_range1,critera1, criteria_range2,critera2…)
• criteria_range1: The first range for which you want to evaluate against criteria1;
• critera1: The first criteria that define which cells to be counted;
• criteria_range2: The second range for which you want to evaluate against criteria2;
• critera2: The second criteria that define which cells to be counted.

To get the number of cells based on two given conditions, please apply the below formula into a blank cell, and press Enter key to get the result:

=COUNTIFS(A2:A12,"T-shirt",D2:D12,">30")

Tips:

1. The SUMPRODUCT function in Excel also can help to count cells that match multiple criteria, please apply the below formula:

=SUMPRODUCT((A2:A12="T-shirt")*(D2:D12>30))

2. For dealing with more criteria, you just need to add other range, criteria pairs within the COUNTIFS or SUMPRODUCT function. For example, to count number of the product T-shirt which size is Medium and Qty is greater than 30, you should apply any one of the following formulas:

=COUNTIFS(A2:A12,"T-shirt",B2:B12,"Medium",D2:D12,">30")
=SUMPRODUCT((A2:A12="T-shirt")*(B2:B12="Medium")*(D2:D12>30))

#### Relative function used:

• COUNTIFS:
• The COUNTIFS function returns the number of cells that meet one single criterion or multiple criteria.

#### More articles:

• Count matches between two columns in Excel
• For example, I have two lists of data in column A and column C, now, I want to compare the two columns and count if the value in column A found in column C in the same row as below screenshot shown. In this case, the SUMPRODUCT function may be the best function for you to solve this task in Excel.
• Count rows if meet internal criteria in Excel
• Supposing, you have a report of product sales of this year and last year, and now, you may need to count products where the sales in this year are greater than last year, or the sales in this year are less than last year as below screenshot shown. Normally, you can add a helper column for calculating the sale difference between the two years, and then use COUNTIF to get result. But, this article, I will introduce the SUMPRODUCT function to get the result directly without any helper column.
• Count rows if meet multiple criteria in Excel
• Count the number of rows in a range based on multiple criteria, some of which depends on the logical tests that work at the row-level, the SUMPRODUCT function in Excel may do you a favor.

### The Best Office Productivity Tools

#### Kutools for Excel - Helps You To Stand Out From Crowd

 🤖 Kutools AI Aide: Revolutionize data analysis based on: Intelligent Execution   |  Generate Code  |  Create Custom Formulas  |  Analyze Data and Generate Charts  |  Invoke Kutools Functions… Popular Features: Find, Highlight or Identify Duplicates  |  Delete Blank Rows  |  Combine Columns or Cells without Losing Data  |  Round without Formula ... Super VLookup: Multiple Criteria  |  Multiple Value  |  Across Multi-Sheets  |  Fuzzy Lookup... Adv. Drop-down List: Easy Drop Down List  |  Dependent Drop Down List  |  Multi-select Drop Down List... Column Manager: Add a Specific Number of Columns  |  Move Columns  |  Toggle Visibility Status of Hidden Columns  |  Compare Columns to Select Same & Different Cells ... Featured Features: Grid Focus  |  Design View  |  Big Formula Bar  |  Workbook & Sheet Manager | Resource Library (Auto Text)  |  Date Picker  |  Combine Worksheets  |  Encrypt/Decrypt Cells  |  Send Emails by List  |  Super Filter  |  Special Filter (filter bold/italic/strikethrough...) ... Top 15 Toolsets:  12 Text Tools (Add Text, Remove Characters ...)  |  50+ Chart Types (Gantt Chart ...)  |  40+ Practical Formulas (Calculate age based on birthday ...)  |  19 Insertion Tools (Insert QR Code, Insert Picture from Path ...)  |  12 Conversion Tools (Numbers to Words, Currency Conversion ...)  |  7 Merge & Split Tools (Advanced Combine Rows, Split Excel Cells ...)  |  ... and more

Kutools for Excel Boasts Over 300 Features, Ensuring That What You Need is Just A Click Away...

#### Office Tab - Enable Tabbed Reading and Editing in Microsoft Office (include Excel)

• One second to switch between dozens of open documents!
• Reduce hundreds of mouse clicks for you every day, say goodbye to mouse hand.
• Increases your productivity by 50% when viewing and editing multiple documents.
• Brings Efficient Tabs to Office (include Excel), Just Like Chrome, Edge and Firefox.