COUNTIFS Function
The Excel COUNTIFS function counts rows that meet multiple conditions. Each condition is supplied as a criteria range and criterion pair, and all conditions use AND logic.
| Excel COUNTIFS Function | ||||||||
| Count records that satisfy multiple criteria at the same time using aligned criteria ranges. | ||||||||
| Source data, editable | COUNTIFS examples | |||||||
| Region | Status | Owner | Amount | Example | Criterion 1 | Criterion 2 | Formula syntax | Result |
| North | Open | Avery | 1,200.0 | North and open | North | Open | =COUNTIFS(A12:A21,F12,B12:B21,G12) | 2 |
| South | Closed | Blair | 850.0 | North above 1,000 | North | >1000 | =COUNTIFS(A12:A21,F13,D12:D21,G13) | 2 |
| North | Open | Casey | 1,450.0 | Open records for Avery | Open | Avery | =COUNTIFS(B12:B21,F14,C12:C21,G14) | 2 |
| West | Pending | Avery | 0.0 | |||||
| East | Closed | Blair | 1,100.0 | How to read the examples | ||||
| North | Closed | Avery | 760.0 | Each criteria pair filters the same source rows. | ||||
| South | Open | Casey | 1,325.0 | Every condition must be true for a row to contribute. | ||||
| West | Closed | Blair | -100.0 | Keep every criteria range aligned with the source values. | ||||
| North | Pending | Casey | 980.0 | |||||
| East | Open | Avery | 1,500.0 | |||||
| Reliability checks | ||||||||
| Every COUNTIFS criteria range covers the same ten source rows | OK | |||||||
| North and open records equal the visible matching rows | OK | |||||||
Overview
The Excel COUNTIFS function counts records only when every specified condition is satisfied. It is the natural extension of COUNTIF when one rule is not enough.
Quick reference
Syntax: =COUNTIFS(criteria_range1, criteria1, [criteria_range2], [criteria2], ...)
Returns: The number of rows for which every supplied condition is true. (number)
Arguments:
criteria_range1(required) — The first range Excel evaluates.criteria1(required) — The condition applied to criteria_range1.criteria_range2(optional) — An additional range aligned row for row with the first criteria range.criteria2(optional) — The condition applied to criteria_range2; additional range and criterion pairs may follow.
Additional criteria-range and criterion pairs are optional. Every supplied condition must pass on the same row or position, and all criteria ranges must have matching dimensions.
Common uses
- Count orders for one region and status.
- Count records owned by one person above a value threshold.
- Count dates inside a reporting period.
- Measure rows that satisfy several completeness or exception checks.
Calculations
COUNTIFS evaluates corresponding positions across its criteria ranges. A row contributes one to the result only when its value in every range meets the paired criterion. Changing the order of the pairs does not change the result.
Every criteria range must have the same dimensions. For example, A12:A21 and B12:B21 are aligned ten-row ranges; combining A12:A21 with B13:B21 either returns an error or tests the wrong record structure.
Criteria follow the same rules as COUNTIF: comparison operators are quoted, a cell-based threshold is concatenated as ">"&G13, text matching is not case-sensitive, and * and ? act as text wildcards. All criteria are joined with AND logic. OR logic normally requires adding separate COUNTIFS results or using another approach.
Function behavior
Situation | Behavior |
|---|---|
Multiple criteria | Uses AND logic; every condition must be true for a row to count. |
One criterion pair | Works like |
Different-sized ranges | Returns |
No matches | Returns |
Text case | Matching is not case-sensitive. |
Comparison operators | Operators must be quoted and concatenated when paired with a cell reference or function result. |
Wildcards | |
Calculated arrays | Criteria ranges must be worksheet ranges rather than arrays returned by other functions. |
Common errors
Counting each condition separately
What happens:
Two COUNTIF results describe separate populations and do not prove that the same rows meet both rules.
Better approach:
Put all aligned range and criterion pairs in one COUNTIFS formula.
Using ranges with different boundaries
What happens:COUNTIFS returns #VALUE! when range dimensions differ, or the intended row alignment is lost.
Better approach:
Make every criteria range start and end on corresponding records.
Expecting OR logic
What happens:
A row that meets only one of two conditions is excluded because COUNTIFS requires both.
Better approach:
Add separate, non-overlapping COUNTIFS results for OR logic, or use a more suitable summary method.
Reversing a range and its criterion
What happens:
The alternating argument structure breaks and Excel cannot evaluate the formula as intended.
Better approach:
Write and review each condition as a visible pair: range first, criterion second.
Example
Example 1 — Two Text Conditions
=COUNTIFS(A12:A21,F12,B12:B21,G12)
With North and Open as the criteria, the workbook counts the two rows where both conditions are true.
Example 2 — Text and Numeric Comparison
=COUNTIFS(A12:A21,F13,D12:D21,G13)
This counts North records whose Amount also meets the comparison stored in G13. The result is 2.
Example 3 — Status and Owner
=COUNTIFS(B12:B21,F14,C12:C21,G14)
The formula counts rows that are Open and assigned to Avery. Two records qualify.
Example workbook
The workbook contains a COUNTIFS Example sheet with ten editable Region, Status, Owner, and Amount records. Three live formulas demonstrate text intersections and a numeric threshold, and two checks verify range alignment and the visible North/Open count. A Notes sheet explains AND logic and criteria construction.
Key takeaway
Pair every condition with an equally sized, row-aligned range, and remember that COUNTIFS includes a record only when all conditions are true.