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.
=COUNTIFS(criteria_range1, criteria1, criteria_range2, criteria2, ... )
Criteria_range1: The first range where you want to evaluate the criteria;
Criteria1: The first criteria that define which cells to be counted.
Criteria_range2, criteria2, ...: The additional ranges and their associated criteria. It allows you to apply no more than 127 range/criteria pairs.
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.
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:
3.1) Drag the AutoFill Handle right to the cell to get the number of females in the same country.
3.2) Keep the row selected, and then drag the AutoFill Handle down to get the number of males and females in the other countries. See screenshot:
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.
The Best Office Productivity Tools
- 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.
Please leave your comments in English