COUNTIFS
Counts cells that satisfy all supplied criteria pairs.
COUNTIFS applies each (criteria_range, criteria) pair and counts rows where all tests pass.
The Formualizer engine in this repository at 0.15.0 plus unreleased changes computes the example results. Known differences from Excel are listed on this page.
Syntax
=COUNTIFS(criteria_range1, criteria1, [(criteria_range2, criteria2), ...])
Arguments
| Argument | Type | Required | Default |
|---|---|---|---|
criteria_range1 | any | Required | — |
criteria1 | any | Required | — |
criteria_range2 | any | Optional | — |
criteria2 | any | Optional | — |
Accepts a variable number of arguments. Minimum: 2.
Differences from Excel
Formualizer accepts array constants as criteria ranges. Excel requires references. An invalid INDIRECT result in a criteria range can raise #NAME? in Formualizer, where Excel returns #REF!.
Remarks
- An equality criterion for a date or number (
"10/26/1999","36459",36459) also matches text cells holding that date;<>and ordering criteria do not read date text. - Requires one or more criteria pairs.
- Criteria support operators and wildcard matching.
- A row contributes to the result only when every criterion evaluates true.
Examples
Count records from one region with a single criteria pair.
Formula =COUNTIFS(A1:A3,"East")
| A | |
|---|---|
| 1 | "East" |
| 2 | "West" |
| 3 | "East" |
Expected result 2
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Count records that meet both the region and numeric requirements.
Formula =COUNTIFS(A1:A3,"East",B1:B3,">15")
| A | B | |
|---|---|---|
| 1 | "East" | 10 |
| 2 | "West" | 50 |
| 3 | "East" | 20 |
Expected result 1
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
No row meets the missing region criterion, so the match count is zero.
Formula =COUNTIFS(A1:A3,"South",B1:B3,">15")
| A | B | |
|---|---|---|
| 1 | "East" | 10 |
| 2 | "West" | 50 |
| 3 | "East" | 20 |
Expected result 0
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Count rows matching two filters
Formula =COUNTIFS(A1:A3, "East", B1:B3, ">=10")
| A | B | |
|---|---|---|
| 1 | "East" | 12 |
| 2 | "East" | 8 |
| 3 | "West" | 15 |
Expected result 1
Try this formula
This editor runs the published Formualizer 0.14.0 package, so the last digits can differ and functions newer than that release return #NAME?.
Related functions
FAQ
Why can COUNTIFS return 0 even when one criterion matches rows?
Each row must satisfy every criterion pair; partial matches are excluded.
Does COUNTIFS require at least one criteria pair?
Yes. It expects arguments in (range, criteria) pairs.