Menu

COUNTIFS in Excel: Count with Multiple Criteria

=COUNTIFS(A2:A7,"North",C2:C7,">50") counts the rows where the region is North and the sales are over 50. Count between two numbers or dates, with OR logic and with blanks, on live sheets.

Every sheet on this page is live: change a number or a formula and it recalculates.

=COUNTIFS(A2:A7,"North",C2:C7,">50") counts the rows where column A is North and column C is greater than 50. COUNTIFS takes pairs of a range and a condition, and a row is counted only when every condition is true.

North orders over 50
F2
ABCDEF
1RegionProductSalesConditionCount
2NorthApple120North, over 502
3SouthPear45North Apple2
4NorthPear80North only3
5EastApple55
6SouthApple200
7NorthApple30
Click a cell to see its formula. Change a number or a formula and the sheet recalculates.

There are three North rows, and two of them are over 50, so F2 shows 2. Change C7 to 90 and the last North row joins the count. F3 pairs two text conditions: North and Apple.

COUNTIFS syntax

=COUNTIFS(criteria_range1, criteria1, [criteria_range2, criteria2], ...)
  • Each condition is a pair: a range and a criterion. Up to 127 pairs are allowed.
  • The criteria work exactly like COUNTIF's: "North", ">50", "<>", "*apple*", or a cell joined to an operator with &, such as ">"&F2.
  • All the ranges must have the same size. They are read row by row: the first cell of every range is one row, the second cell of every range the next.
  • The conditions are joined with AND. For OR, see below.

COUNTIFS is in every Excel since 2007 and in Google Sheets.

COUNTIFS between two numbers

To count values in a band, use the same range twice, once with the lower bound and once with the upper one.

Sales from 50 to 150
F4
ABCDEF
1RegionProductSalesSettingValue
2NorthApple120Min50
3SouthPear45Max150
4NorthPear80Between3
5EastApple55
6SouthApple200
7NorthApple30
Click a cell to see its formula. Change a number or a formula and the sheet recalculates.

120, 80 and 55 fall inside 50 to 150, so F4 shows 3. Change the bounds in F2 and F3 and the count follows. ">=" and "<=" include the bounds; use ">" and "<" to leave them out.

COUNTIFS between two dates

Dates work the same way. Keep the start and end dates in cells and join them to the operators, so you never type a date inside the quotes.

Orders in February
F4
ABCDEF
1RegionSalesDateSettingValue
2North1202026-01-05Start2026-02-01
3South452026-01-12End2026-02-28
4North802026-02-03Orders2
5East552026-02-18North orders1
6South2002026-03-02
7North302026-03-20
Click a cell to see its formula. Change a number or a formula and the sheet recalculates.

Two orders fall in February, and one of them is from North. F5 has three pairs: one for the region and two for the date window. If your dates carry a time (2026-02-28 16:30), "<="&F3 misses everything after 0:00 on the last day; use "<"&F3+1 instead.

COUNTIFS with OR logic

COUNTIFS has no OR. To count North or South orders over 50, give the region criterion a list in braces. COUNTIFS then returns one count per item, and SUM adds them up.

North or South, over 50
F2
ABCDEF
1RegionProductSalesConditionCount
2NorthApple120North or South, over 503
3SouthPear45Same, two COUNTIFS3
4NorthPear80
5EastApple55
6SouthApple200
7NorthApple30
Click a cell to see its formula. Change a number or a formula and the sheet recalculates.

Both formulas give 3: two North rows and one South row over 50. The braces version is shorter when the list grows. Use the list on one criterion only. Two lists in the same formula pair their items up instead of trying every combination, which is rarely what you want.

When the items are in cells (say E8:E9), =SUMPRODUCT(COUNTIFS(A2:A7,E8:E9,C2:C7,">50")) does the same without braces.

COUNTIFS not blank

"<>" means "not empty" and "" means "empty", so a column of ship dates tells you which orders are still open.

Open and shipped orders
F2
ABCDEF
1RegionOrderShippedConditionCount
2NorthA-1012026-01-08North, shipped2
3SouthA-102North, not shipped1
4NorthA-1032026-02-06
5EastA-1042026-02-20
6SouthA-105
7NorthA-106
Click a cell to see its formula. Change a number or a formula and the sheet recalculates.

Two North orders have a ship date and one does not. Type a date into C7 and the counts move from F3 to F2. A formula that returns an empty string ("") is counted by "" and also by "<>"; COUNTIF not blank explains the workarounds.

Practice: two conditions

Your turn: South apples
F2
ABCDEF
1RegionProductSalesConditionCount
2NorthApple120South Apple
3SouthPear45
4NorthPear80
5EastApple55
6SouthApple200
7NorthApple30
8SouthApple75
Click a cell to see its formula. Change a number or a formula and the sheet recalculates.

Your turn: Count the rows where the region is South and the product is Apple. Write the formula in F2.

Your turn: big orders in a date window
F4
ABCDEF
1RegionSalesDateSettingValue
2North1202026-01-05Start2026-01-01
3South1452026-01-12End2026-02-28
4North802026-02-03Count
5East1552026-02-18
6South2002026-03-02
7North302026-03-20
8West1102026-02-25
Click a cell to see its formula. Change a number or a formula and the sheet recalculates.

Your turn: Count the orders from the date in F2 to the date in F3 (both included) with sales of at least 100. Write the formula in F4.

Why COUNTIFS returns #VALUE! or 0

  • Ranges of different sizes. =COUNTIFS(A2:A7,"North",C2:C6,">50") returns #VALUE! because A2:A7 has six cells and C2:C6 five. Make every range start and end on the same rows.
  • An AND that can never be true. =COUNTIFS(A2:A7,"North",A2:A7,"South") is always 0: one cell cannot be both. That is an OR, so use the braces version above.
  • A date typed inside the quotes. ">=1/2/2026" is read in your system's date order. Put the date in a cell and write ">="&F2.
  • Operator and cell inside the quotes. ">=F2" compares against the text F2. Write ">="&F2.

COUNTIFS counts rows. To add up a column for the same rows, the arguments are almost identical with SUMIFS; for conditions COUNTIFS cannot express (one column compared to another, a calculation on each row), use SUMPRODUCT.

Frequently Asked Questions

What is the difference between COUNTIF and COUNTIFS?

COUNTIF takes one range and one condition. COUNTIFS takes any number of range and condition pairs and counts the rows where all of them are true: =COUNTIFS(A2:A7,"North",C2:C7,">50"). With one pair, COUNTIFS gives the same result as COUNTIF.

How do I count between two dates with COUNTIFS?

Use the date column twice, once with each bound: =COUNTIFS(C2:C7,">="&F2,C2:C7,"<="&F3) counts the dates from F2 to F3, both included.

How do I use COUNTIFS with OR?

COUNTIFS always joins its conditions with AND. For OR, give one criterion a list in braces and add the results: =SUM(COUNTIFS(A2:A7,{"North","South"},C2:C7,">50")).

Why does COUNTIFS return #VALUE!?

The ranges are not the same size. Every range in COUNTIFS must have the same number of rows and columns, so A2:A7 cannot be paired with C2:C6.

How do I count values between two numbers with COUNTIFS?

Use the same range twice, once per bound: =COUNTIFS(C2:C7,">=50",C2:C7,"<=150") counts the values from 50 to 150, both included. Use ">" and "<" to leave the bounds out.

Coddy programming languages illustration

Learn to code with Coddy

GET STARTED