COUNTIFS Function in Google Sheets

COUNTIFS counts rows that meet several conditions at the same time. Add one range-and-criterion pair for each condition, and a row counts only when every pair matches.

For example, =COUNTIFS(B2:B8,"East",C2:C8,"Closed") counts rows where Region is East and Status is Closed.

COUNTIFS Function Syntax in Google Sheets

=COUNTIFS(criteria_range1, criterion1, [criteria_range2, criterion2, ...])
  • criteria_range1 is the first range to test.
  • criterion1 is the value, pattern, or comparison the first range must meet.
  • Additional range-and-criterion pairs add more required conditions.

When to Use COUNTIFS

  • Count rows matching two or more labels.
  • Count numbers inside a lower and upper limit.
  • Count records within a date range.
  • Mix text, numeric, wildcard, and date conditions.
  • Require three or more conditions at once.

Count Rows Matching Two Conditions

OrderRegionStatusQtyDate
1001EastClosed12May 1, 2026
1002WestOpen20May 15, 2026
1003EastClosed25May 31, 2026 at noon
1004EastOpen10June 1, 2026
1005WestClosed15April 30, 2026
1006EastClosed20May 20, 2026
1007WestClosed9May 20, 2026
=COUNTIFS(B2:B8,"East",C2:C8,"Closed")

The tested result is 3. A row counts only when both East and Closed appear in that row.

Use COUNTIF when you need only one condition.

Count Numbers Within a Range

=COUNTIFS(D2:D8,">=10",D2:D8,"<=20")

Both conditions test the Qty column. The tested result is 5, including values equal to 10 or 20.

Use > and < instead when the boundary values should be excluded.

Count Entries Inside a Date Range

For all May 2026 records, include May 1 and stop before June 1:

=COUNTIFS(E2:E8,">="&DATE(2026,5,1),E2:E8,"<"&DATE(2026,6,1))

The tested result is 5. It includes the May 31 noon timestamp because every time on that date is still before June 1.

COUNTIFS includes May 31 timestamps by using an exclusive June 1 upper boundary; result 5.

Combine a Text and Number Condition

=COUNTIFS(B2:B8,"East",D2:D8,">20")

This pattern mixes a text label with a numeric threshold. Operators such as > stay inside quotation marks.

Count Rows Matching Three Conditions

=COUNTIFS(B2:B8,"East",C2:C8,"Closed",D2:D8,">=20")

The tested result is 2. Those rows are East, Closed, and have Qty of at least 20.

Match Partial Text With Wildcards

=COUNTIFS(B2:B8,"East",C2:C8,"Cl*")

The asterisk matches any following characters. The tested result is 3 because Cl* matches Closed in the East rows.

Use OR Logic With COUNTIFS

Criteria pairs inside one COUNTIFS use AND logic. For East or West while Status is Closed, sum two counts:

=COUNTIFS(B2:B8,"East",C2:C8,"Closed")+COUNTIFS(B2:B8,"West",C2:C8,"Closed")

The tested result is 5. This form is easy to audit and works without an ARRAYFORMULA wrapper.

For many OR values, an array form can be shorter:

=SUM(ARRAYFORMULA(COUNTIFS(B2:B8,{"East","West"},C2:C8,"Closed")))

This corrected formula also returned 5. Without ARRAYFORMULA in the tested sheet, SUM used only the first array result and returned 3.

Google’s COUNTIFS reference documents the syntax and equal-size requirement.

Other Google Sheets articles you may also like