1. Home
  2. Functions
  3. Statistical
  4. COUNTIF

COUNTIF function

Counts the cells in a range that meet a condition.

Syntax

=COUNTIF(range, criteria)

Arguments

ArgumentRequiredDescription
rangeRequiredThe cells to check
criteriaRequiredThe condition, like 5, ">10", "apple" or "a*"

How to use COUNTIF

COUNTIF takes 2 required arguments. Type =COUNTIF( in a cell and SheetsBat shows the arguments as you go. Optional arguments are shown in square brackets; leave them out to use their default.

Examples

Each result below was calculated by the SheetsBat formula engine.

=COUNTIF(A1:A4, ">2")Result 2
Data in the sheet
A
11
23
35
4x
=COUNTIF(A1:A3, "a*")Result 2
Data in the sheet
A
1apple
2avocado
3pear

Every formula, right in your browser

SheetsBat calculates 536 functions, with charts, pivot tables and live collaboration. Free to start.