cellio

How to Count Cells With Text in Excel

Count cells with any text, exact text, or text containing a word in Excel using COUNTIF and wildcards, without counting blanks or numbers.

By Ayoub Farid · · 1 min read

Counting cells that contain text sounds simple, but "text" can mean any text, one exact word, or a word somewhere inside the cell. Here's the formula for each.

Any text

=COUNTIF(A2:A100,"*")

The * wildcard matches any text. Numbers and blanks aren't counted.

Exact text

=COUNTIF(A2:A100,"Paid")

Not case-sensitive.

Text that contains a word

=COUNTIF(A2:A100,"*refund*")

Matches "Refund", "Partial refund", "refunded".

With the word in a cell:

=COUNTIF(A2:A100,"*"&F1&"*")

Starts or ends with

=COUNTIF(A2:A100,"INV*")
=COUNTIF(A2:A100,"*.pdf")

Not equal to some text

=COUNTIF(A2:A100,"<>Paid")

Careful: this also counts blank cells. To exclude blanks:

=COUNTIFS(A2:A100,"<>Paid",A2:A100,"<>")

Any non-empty cell (text or numbers)

=COUNTA(A2:A100)

See COUNT vs COUNTA.

Case-sensitive count

=SUMPRODUCT(--EXACT(A2:A100,"PAID"))

Common gotcha: invisible spaces

"Paid " with a trailing space won't match "Paid". Clean the column with TRIM or use "Paid*".

More on conditions in COUNTIF.

Frequently asked questions

How do I count cells that contain text in Excel?

=COUNTIF(range,"*").

How do I count cells containing a specific word?

=COUNTIF(range,"*word*").

Does COUNTIF count numbers as text?

No. The "*" wildcard only matches text values.

How do I count non-blank cells?

=COUNTA(range).

Keep reading