COUNTIFS Function
Counts the rows that meet several conditions.
Category
Statistical
Available in
Excel 2007+, Microsoft 365
Returns
A whole number
Overview
COUNTIFS counts rows where every condition is true (AND logic). Each condition is a range paired with its criteria, and all ranges must be the same size.
Criteria can be a value ("North", 50000), a comparison in quotes (">=50000", "<>North"), a comparison joined to a cell (">="&F2), or a pattern with wildcards — * for any characters, ? for one character ("A*", "?d"). Text matching ignores upper/lower case.
Syntax
Arguments
| Argument | Required? | What it does |
|---|---|---|
| criteria_range1 | Yes | The first range to test. |
| criteria1 | Yes | The condition for criteria_range1. |
| criteria_range2, criteria2, … | No | Up to 126 more range/condition pairs. |
Examples
Example 1 — Several conditions
Region plus sales level, and a "between" count using the same column twice.
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Rep | Region | Sales | Measure | Result |
| 2 | Ana | North | 62000 | North, 50k+ | 3 |
| 3 | Ben | South | 48500 | South, <45k | 1 |
| 4 | Cy | North | 50000 | 45k–60k | 4 |
| 5 | Di | East | 71250 | ||
| 6 | Ed | South | 39800 | ||
| 7 | Fay | North | 55400 | ||
| 8 | Gus | East | 48500 |
Example 2 — OR logic: North or East
COUNTIFS only does AND. Give it a list of criteria and add the results.
Returns 5 (3 North + 2 East).
Common mistakes
- #VALUE! The criteria ranges are different sizes or shapes.
- Comparison without quotes. =COUNTIF(C2:C8,>50000) is an error. Write ">50000" in quotes, or ">"&F2 to use a cell.
- Putting the cell inside the quotes. ">F2" compares with the text "F2". Join the cell instead: ">"&F2.
Notes
- Related functions: COUNTIF, SUMIFS, AVERAGEIFS, MAXIFS.

Author
Kyle Stott
Certified Microsoft Excel Expert
Kyle has worked professionally with Microsoft Excel for over a decade and has consulted on and taught Excel best practices to over 400 companies across 30+ countries.