Statistics formula
COUNTIFS in Excel and Google Sheets
Count rows that meet one or more conditions.
Syntax
=COUNTIFS(criteria_range1, criteria1, [criteria_range2, criteria2], ...)- criteria_range1
- The column to test.
- criteria1
- The condition.
Example
| Row | A | B |
|---|---|---|
| 1 | Region | Status |
| 2 | North | Won |
| 3 | South | Lost |
| 4 | North | Won |
| 5 | ||
| 6 | North won |
B6 =COUNTIFS(A2:A4,"North",B2:B4,"Won")
Result: 2
Counts rows where region is North and status is Won.
Ready-to-copy formulas
Count orders in the last 30 days
=COUNTIFS(A:A,">="&TODAY()-30)Count non-empty cells meeting a condition
=COUNTIFS(A:A,"North",C:C,"<>")
Tips
- All ranges must be the same size.
- "<>" means not empty.
Need the whole spreadsheet?
Start from a free template with every formula already in place. Opening a template uses no credits.