Statistical

COUNTIFS Formula

COUNTIFS counts cells that meet multiple criteria simultaneously across multiple ranges. It extends COUNTIF by allowing you to specify conditions on different columns at the same time. Every criteria range must be the same size, and a row is only counted when all conditions are true.

Syntax

COUNTIFS(range1, criteria1, ...)
ParameterDescription
range1 Parameter of the COUNTIFS function.
criteria1 Parameter of the COUNTIFS function.
... Parameter of the COUNTIFS function.
Try COUNTIFS in Viztab — free, no signup

Examples

ABCD
1RegionSalesStatusDate
2East1200Shipped2024-01-15
3West800Pending2024-02-20
4East2100Shipped2024-03-05
5East450Cancelled2024-01-28

Count orders by region and status

Formula
=COUNTIFS(A2:A100, "East", C2:C100, "Shipped")
Returns: 14 — the number of rows where region is "East" AND status is "Shipped"

Count within a date range

Formula
=COUNTIFS(D2:D100, ">="&DATE(2024,1,1), D2:D100, "<"&DATE(2024,4,1))
Returns: 23 — counts entries dated in Q1 2024 (January through March)

Count values in a numeric range

Formula
=COUNTIFS(B2:B100, ">=80", B2:B100, "<=90")
Returns: 12 — counts scores between 80 and 90 inclusive

Common Errors

#VALUE!

The criteria ranges have different sizes. All ranges in COUNTIFS must have the same number of rows and columns.

Returns 0

No rows match ALL criteria simultaneously. Check each criterion individually with COUNTIF to see which one is too restrictive.

Tips

Same column, two criteria

Use the same range twice for between: =COUNTIFS(B:B, ">=10", B:B, "<=20") counts values from 10 to 20.

Cell references in criteria

For dynamic criteria: =COUNTIFS(A:A, F1, B:B, ">"&G1) uses cell values instead of hardcoded criteria.

OR logic workaround

COUNTIFS uses AND logic. For OR, add separate COUNTIFS: =COUNTIFS(A:A,"East",B:B,">100")+COUNTIFS(A:A,"West",B:B,">100").

Try COUNTIFS in Viztab

Import your data and use COUNTIFS with 370+ other formulas. No signup required.

Open Viztab

Related Formulas