Skip to main content

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, ... )


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:

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

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.
Comments (0)
No ratings yet. Be the first to rate!
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
Rate this post:
0   Characters
Suggested Locations