Returns the count of a range depending on multiple criteria.
COUNTIFS for BigQuery

Returns the count of rows depending on multiple criteria

Sample usage

COUNTIFS(table_name!fruits, “Apple”, table_name!inventory, “<30”)


COUNTIFS(criteria_column1, criterion1, criteria_column2, criterion2)

  • criteria_column1 – The data column to check against 'criterion1'.
  • criterion1 – The pattern or test to apply to 'criteria_column1'.
  • criteria_column2 – Additional data column to check.
  • criterion2 – Additional criteria to check.

Sample usage

COUNTIFS(A1:A10, ">20", B1:B10, "<30")

COUNTIFS(A7:A24, ">6", B7:B24, "<"&DATE(1969,7,20))

COUNTIFS(B8:B27, ">" & B12, C8:C27, "<" & C13, D8:D27, “<>10”)

COUNTIFS(C1:C100, "Yes")


COUNTIFS(criteria_range1, criterion1, [criteria_range2, criterion2, ...])

  • criteria_range1 – The range to be checked against criterion1.
  • criterion1 – The pattern or test to be applied to criteria_range1.
  • criteria_range2, criterion2…[ OPTIONAL ] – Additional ranges and criteria to be checked; repeatable.


  • Any additional ranges must contain the same number of rows and columns as criteria_range1.

See also

COUNTIF: Returns a conditional count across a range.


Returns the number of numeric values in a data set.


SUMIFS: Returns the sum of a range depending on multiple criteria.

AVERAGEIFS: Returns the average of a range depending on multiple criteria.

IF: Returns one value if a logical expression is 'TRUE' and another if it is 'FALSE'.

Visit the Learning Center

Using Google products, like Google Docs, at work or school? Try powerful tips, tutorials, and templates. Learn to work on Office files without installing Office, create dynamic project plans and team calendars, auto-organize your inbox, and more.

Clear search
Close search
Google apps
Main menu