Two-way summary counting in Excel using COUNTIFS
The COUNTIF function can be used to count the number of cells that meet a certain criterion in Excel. But sometimes, you may need to count cells based on more than one criterion. In this tutorial, we will discuss how to use the COUNTIFS function to create two-way summary count in Excel.
How to perform two-way summary counting using COUNTIFS?
As shown in the table below, supposing you want to count how many males and females there are in the given countries respectively, you can follow the below steps.
Generic Formulas
=COUNTIFS(criteria_range1, criteria1, criteria_range2, criteria2, ... )
Arguments
How to use this formula?
In this case, $D$3:$D$11 is the range1, China is the criteria1 that locates in $G3, $E$3:$E$11 is the range2, and H$2 is the cell reference containing the criteria2.
1. Select a cell to place the first result. In this case, I select cell H3.
2. Enter the below formula into it and press the Enter key to get the result.
=COUNTIFS($D$3:$D$11,$G3,$E$3:$E$11,H$2)
Note: If the criteria argument is a reference to an empty cell, the COUNTIFS function treats the empty cell as a 0 value.
3. Select the first result cell:
Related functions
Excel COUNTIF function
The Excel IF function is a statistical function in Excel which is used to count the number of cells that meet a criterion.
Related formulas
3D sum or sumif across multiple worksheets
This tutorial talks about how to sum the same range of cells across multiple consecutive or discontiguous worksheets in Excel.
Calculate running total
This tutorial explains a simple formula to help calculating running total in Excel.
Get subtotal by invoice number
This tutorial explains a formula based on the COUNTIF and SUMIF functions to get subtotal by invoice number in Excel.
Subtotal by colors
This step-by-step guide helps you perform subtotal by color with the SUMIF function.
The Best Office Productivity Tools
Kutools for Excel - Helps You To Stand Out From Crowd
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.