How to Count Cells with Text in Excel (any text, or specific text)

By Srini Vanamala / September 29, 2026 / Formulas & Functions
How to Count Cells with Text in Excel (any text, or specific text)

Three slightly different questions, three formulas. Pick the one you mean.

Count cells that contain any text

=COUNTIF(A1:A100, "*")

The * wildcard matches any text. Numbers, dates and blanks are not counted.

A
1 Ana
2 120
3 Raj

Result: 2.

Count cells with specific text

=COUNTIF(A1:A100, "Ana")

Contains the word anywhere: =COUNTIF(A1:A100, "*Ana*"). Case is ignored.

Count non-empty cells (text and numbers)

=COUNTA(A1:A100)

Count only numbers

=COUNT(A1:A100)

Steps

  1. Click an empty cell outside the range.
  2. Type the formula you need. Enter.

Check it worked

COUNTA should equal COUNT plus your text count, if there are no blanks or errors in the range.

Common mistakes

A cell with a single space counts as text. It looks empty but “*” matches it. Clean with TRIM or Find and Replace.

A formula that returns “” counts as text with COUNTA but not with COUNTIF “*”? Actually COUNTIF “*” does count it too. Use =SUMPRODUCT(--(LEN(TRIM(A1:A100))>0)) to count only cells with real characters.

← →
Srini Vanamala

20 years with spreadsheets and enterprise systems. Writes one short, plain-English Excel lesson a day. Got an Excel question? learnexceleasycom@gmail.com

Have a question about this lesson?

Ask anything — I read every comment. Your email is never shown.