Home

countif

COUNTIF is a spreadsheet function that counts the number of cells within a range that meet a specified condition. It is available in spreadsheet programs such as Microsoft Excel and Google Sheets. The syntax is COUNTIF(range, criterion). The range must be a contiguous block of cells; the criterion defines what to count and can be a number, a text string, an expression, or a reference to a cell.

Criteria can include wildcards: an asterisk (*) matches any sequence of characters, and a question mark (?) matches

COUNTIF is not case-sensitive: "Apple" and "apple" are counted the same. It can also count blank cells

Common uses include tallying occurrences of categories, flagging data that meets thresholds, and validating inputs. COUNTIF

a
single
character.
They
are
useful
for
filtering
textual
data,
for
example
COUNTIF(A2:A100,
"Yes")
counts
cells
equal
to
Yes,
and
COUNTIF(A2:A100,
"A*")
counts
cells
starting
with
the
letter
A.
For
numeric
comparisons,
you
can
include
operators
in
quotes,
such
as
COUNTIF(B2:B100,
">5")
or
COUNTIF(B2:B100,
"<="
&
C1)
where
C1
contains
a
threshold
value.
with
an
empty
string
criterion,
such
as
COUNTIF(D2:D100,
"").
For
more
complex
criteria
involving
multiple
conditions,
COUNTIF
is
combined
with
other
functions,
or
the
dedicated
COUNTIFS
function
is
used
that
supports
multiple
criteria.
is
a
fundamental
tool
for
data
analysis
in
spreadsheets.