Spreadsheet Practice

How to count cells that contain any text in Excel

Formula (Excel and Google Sheets)

=COUNTIF(B2:B10,"*")

Use a lone asterisk as the criteria: =COUNTIF(B2:B10,"*") counts cells that hold text and skips numbers, dates and blanks.

Result on the example
4 in E1
Works in
Every current version
Google Sheets
Same formula

See it work

The formula is already in E1. Change any input and the result updates, or edit the formula to experiment.

How it works

The asterisk wildcard matches any text of any length, and wildcards only ever match text. So "*" counts "Absent" and "Excused" but not the numeric scores or the blank cell.

Iris's "64" is counted too: it was typed or imported as text, which is exactly the kind of cell this count helps you find.

=COUNTIF(B2:B10,"*")

Result4

  1. B2:B109 rows × 1 col: 88, "Absent", 92, (empty), …

    A range: 9 cells in one column.

  2. COUNTIF(B2:B10,"*")4

    COUNTIF: Counts cells that meet one condition.

    • rangeB2:B109 rows × 1 col: 88, "Absent", 92, (empty), …
    • criteria"*"

In Google Sheets

The same formula works in Google Sheets: =COUNTIF(B2:B10,"*"). We ran it in Google Sheets mode on the same data and it returns 4.

Other ways to do it

Each one was run on the same example sheet.

FormulaResultWhen to use it
=SUMPRODUCT(--ISTEXT(B2:B10))4ISTEXT tests each cell; the same count, and easy to combine with other conditions.
=COUNTA(B2:B10)-COUNT(B2:B10)4Everything that isn't empty, minus the numbers. Same here, but it also counts errors and TRUE/FALSE values.

Common mistakes

  • A formula that returns "" counts as text for "*", even though the cell looks empty. Use =COUNTIF(B2:B10,"?*") to require at least one character.
  • Numbers stored as text, like "64" here, are text. If they should be scores, convert them so averages include them.

Try it yourself

Same data, empty answer cell. Your formula is graded instantly, then re-checked on changed data, so a typed-in number won't pass.

Count cells that contain any text

In E1, count the cells in B2:B10 that contain text rather than a score.

Questions

How do I count cells that contain only numbers?

Use =COUNT(B2:B10), which counts numbers and dates.

How do I count text cells that meet another condition?

Combine the wildcard with COUNTIFS: =COUNTIFS(B2:B10,"*",A2:A10,"<>Dan").

Checked by running on 2026-10-30: every formula and result on this page was calculated by the Spreadsheet Practice formula engine, in both Excel and Google Sheets modes.