SheetsLessons
Conditional function

COUNTIFS function in Google Sheets

COUNTIFS counts rows that meet several conditions at once, e.g. orders that are from the West and over $1,000. Every condition must be true for a row to be counted.

Syntax

=COUNTIFS(criteria_range1, criterion1, [criteria_range2, criterion2, ...])
criteria_range1
The first range to test.
criterion1
The condition for that range.
criteria_range2, criterion2, ...
Optional. More range/condition pairs. All ranges must be the same size.

Practice COUNTIFS

Task 1 of 3

Count orders from the West region that were also over $500. Answer in E2.

E2
fx

Tip: while typing a formula, click a cell or drag across cells to insert references. Press Enter to check, and Tab to accept a function suggestion.

COUNTIFS examples

Each example below runs against this sample sheet. The results are calculated by the same engine as the practice grid.

ABCDE
1RepRegionProductUnitsRevenue
2AvaWestMonitor12$2,400.00
3LiamEastKeyboard30$1,500.00
4MayaWestMouse45$900.00
5NoahNorthMonitor8$1,600.00
6ZaraEastMonitor15$3,000.00
7OmarWestKeyboard22$1,100.00
Sales by rep
FormulaResultWhat it shows
=COUNTIFS(B2:B7, "West", C2:C7, "Monitor")1West AND Monitor.
=COUNTIFS(D2:D7, ">=10", D2:D7, "<=30")4Between two values: same range, two conditions.
=COUNTIFS(B2:B7, "East", E2:E7, ">2000")1Text and numeric conditions together.

Tips and common mistakes

  • COUNTIFS is always AND logic. For OR (West or East), add two COUNTIFs together.
  • Ranges of different sizes return #VALUE!.

Related functions