Statistical function

COUNTIFS function

Counts the rows that meet several conditions at once, such as deals that are in the North region and won and worth at least 2,000.

Available in Excel 2007 and later, Excel for the web, Excel for Mac

Excel 2007 and laterWorks in Google Sheets

Syntax

COUNTIFS(criteria_range1, criteria1, [criteria_range2, criteria2], ...)
ArgumentWhat it means
criteria_range1RequiredThe first range to test.
criteria1RequiredThe condition for that range, written like a COUNTIF criterion ("Won", ">=2000", ">="&F1, "A*").
criteria_range2, criteria2, ...OptionalUp to 126 more range/condition pairs. Every range must have the same number of rows and columns as the first.

Returns: A whole number: how many rows pass every condition.

How COUNTIFS works

COUNTIFS counts rows that satisfy all of your conditions at the same time. Each condition is a pair: the column to test and the test itself. Think of it as applying several filters to a table and reading off how many rows remain. It answers questions such as "how many deals did we win in the North?" or "how many high-priority tickets were opened in April?"

Excel works through the ranges position by position: the first cell of each range belongs to row 1, the second to row 2, and so on. A row is counted only when every pair says yes, so the conditions are joined with AND. Testing the same column twice gives you a range (between two dates or two amounts). The criteria rules are the same as in COUNTIF: case-insensitive text, operators inside quotes, & to join an operator to a cell, and */? wildcards.

With one pair COUNTIFS behaves exactly like COUNTIF, so many people use COUNTIFS everywhere. For OR logic (North or South) add two COUNTIFS together, or use an array constant inside SUM.

Examples

1Deals won in the North

F2fx=COUNTIFS(A2:A7, "North", C2:C7, "Won")
ABCDEF
1RegionRepStatusAmount
2NorthAnaWon42003
3SouthBenLost1800
4NorthCleoWon950
5NorthAnaLost3100
6SouthDevWon5600
7NorthCleoWon2700

Result: 3

Four deals are in the North and four are Won, but only three are both (Ana 4,200, Cleo 950 and Cleo 2,700). COUNTIFS returns 3.

2Add a third condition on the amount

F2fx=COUNTIFS(A2:A7, "North", C2:C7, "Won", D2:D7, ">=2000")
ABCDEF
1RegionRepStatusAmount
2NorthAnaWon42002
3SouthBenLost1800
4NorthCleoWon950
5NorthAnaLost3100
6SouthDevWon5600
7NorthCleoWon2700

Result: 2

The extra pair removes Cleo's 950 deal, leaving the 4,200 and 2,700 deals. Each new pair can only keep the count the same or make it smaller.

3High-priority tickets opened in April

D2fx=COUNTIFS(A2:A7, ">="&DATE(2026,4,1), A2:A7, "<"&DATE(2026,5,1), B2:B7, "High")
ABCD
1OpenedPriority
22026-03-28High2
32026-04-02Low
42026-04-09High
52026-04-15High
62026-04-30Medium
72026-05-03High

Result: 2

The date column is tested twice to create the window 1–30 April. Inside it, the 9 April and 15 April tickets are High priority; the 28 March and 3 May High tickets fall outside the window. The answer is 2.

4North or South: add two counts

F2fx=SUM(COUNTIFS(A2:A7, {"North","South"}, C2:C7, "Won"))
ABCDEF
1RegionRepStatusAmount
2NorthAnaWon42004
3SouthBenLost1800
4NorthCleoWon950
5NorthAnaLost3100
6SouthDevWon5600
7NorthCleoWon2700

Result: 4

The array constant makes COUNTIFS run twice, once for North (3 wins) and once for South (1 win, Dev). SUM adds the two results to give 4 won deals across both regions.

⬇Practice workbookExamples with live formulas + practice sheets · .xlsx · 19 KB

Common errors and how to fix them

ErrorWhy it happensFix
#VALUE!The ranges are different sizes, e.g. A2:A7 and C2:C8.Make every range start and end on the same rows.
Result is 0 unexpectedlyOne condition matches nothing: a typo, extra spaces, dates stored as text, or a comparison without quotes.Test each pair alone to find the culprit; convert text dates with DATEVALUE.

Tips

  • Keep the criteria in cells (a small filter panel above the table) so users can change them: =COUNTIFS(A2:A7, G1, C2:C7, G2).
  • To ignore a condition when its cell is empty, use "*"&G1 for text columns: an empty G1 becomes "*", which matches any text.
  • COUNTIFS cannot test a calculation of a column (such as the month of a date). Use a helper column or =SUMPRODUCT((MONTH(A2:A7)=4)*(B2:B7="High")).

Questions

How many conditions can COUNTIFS handle?

Up to 127 range/criteria pairs, far more than you will normally need.

Can COUNTIFS look at different columns of different lengths?

No. Every range must be the same size and shape, because Excel compares them row by row.

How do I count dates in a particular month?

Test the date column twice: ">="&DATE(2026,4,1) and "<"&DATE(2026,5,1). This includes every time of day on the last day of the month.

Google Sheets

COUNTIFS also exists in Google Sheets and works the same way for everyday use, so the examples above work there too.

COUNTIFS in other languages

In a non-English version of Excel the function has a local name. Excel translates formulas automatically when a file is opened in another language.

LanguageFunction name
DanishTÆL.HVISER
DutchAANTALLEN.ALS
FinnishLASKE.JOS.JOUKKO
FrenchNB.SI.ENS
GermanZÄHLENWENNS
HungarianDARABHATÖBB
ItalianCONTA.PIÙ.SE
Norwegian (Bokmål)ANTALL.HVIS.SETT
PolishLICZ.WARUNKI
Portuguese (Brazil)CONT.SES
Portuguese (Portugal)CONTAR.SE.S
RussianСЧЁТЕСЛИМН
SpanishCONTAR.SI.CONJUNTO
SwedishANTAL.OMF
TurkishÇOKEĞERSAY

Recipes that use COUNTIFS