FormulaCamp
Completed
← All functions
Statistics

COUNTIFS

Counts with several conditions.

Syntax

COUNTIFS(criteria_range1, criteria1, …)

Example: =COUNTIFS(A:A,"Boston",C:C,">0")

Available in: All versions

COUNTIFS counts the rows that meet all of several conditions: =COUNTIFS(criteria_range1, criteria1, …). It answers questions like how many orders from the East were over $500, or how many tickets are open and high priority.

When to use it

Arguments explained

Worked examples

Region and amount

ABC
1RegionRepAmount
2EastAna1200
3WestBen850
4EastCara430
5NorthDan970
6WestEli1500
7EastAna610

Formula: E2: =COUNTIFS(A2:A7,"East",C2:C7,">500")

Result: 2

East rows above 500: 1200 and 610.

Region and rep

ABC
1RegionRepAmount
2EastAna1200
3WestBen850
4EastCara430
5NorthDan970
6WestEli1500
7EastAna610

Formula: E2: =COUNTIFS(A2:A7,"East",B2:B7,"Ana")

Result: 2

Ana has two East rows.

Between two values

ABC
1RegionRepAmount
2EastAna1200
3WestBen850
4EastCara430
5NorthDan970
6WestEli1500
7EastAna610

Formula: E2: =COUNTIFS(C2:C7,">500",C2:C7,"<1000")

Result: 3

Amounts over 500 and under 1000: 850, 970 and 610.

Try it

A tiny spreadsheet with example data. Edit the formula or any number and see the result.

Formula in F2: =COUNTIFS(A2:A7,"East",C2:C7,">20")

Example spreadsheet for COUNTIFS
ABCDEF
1RegionProductUnitsPriceResult
2EastPen1202.52
3WestPen802.5
4EastBook4512
5NorthBook6012
6WestLamp3025
7EastLamp1525
Result in F2: 2
Practice this in a lesson: Multiple Conditions

Common errors and how to fix them

Related functions

Frequently asked questions

What is the difference between COUNTIF and COUNTIFS?
COUNTIF takes one condition; COUNTIFS takes up to 127 range and condition pairs.
How do I count between two dates?
Use two criteria on the date column: ">="&start and "<="&end.
Can I use wildcards?
Yes, in text criteria: "A*" and "?n*".
How do I count blanks with COUNTIFS?
Use "" as the criteria for an empty cell.

More in Statistics