Confident CellsExcel practice Start free

Count cells with text, numbers or blanks in Excel

Updated 26 November 2026 · 4 min read

To count the cells in C2:C21 that have text in them, use =COUNTIF(C2:C21,"*"), or take the numbers away from everything: =COUNTA(C2:C21)-COUNT(C2:C21). COUNTA counts anything that isn't empty, COUNT counts numbers, and COUNTBLANK counts the empty cells. They all work in every version of Excel, on Windows and Mac and in Excel for the web.

Counting cells at a glance

You want to countFormulaNotes
Cells with any text=COUNTIF(B2:B11,"*")Numbers and empty cells are left out; use "?*" to skip formulas that show nothing
The same, another way=COUNTA(B2:B11)-COUNT(B2:B11)Everything, take away the numbers
Cells that contain a word=COUNTIF(B2:B11,"*late*")Capitals don't matter
Cells with a number=COUNT(B2:B11)Dates count as numbers
Cells that aren't empty=COUNTA(B2:B11)Or =COUNTIF(B2:B11,"<>")
Empty cells=COUNTBLANK(B2:B11)Also counts formulas that show nothing
Text in one group only=COUNTIFS(A2:A11,"Sales",B2:B11,"*")A pair for each condition

Each one is worked through below.

A worked example

Ten people were asked to rate an away day out of 10. Five gave a number, two wrote something instead (n/a, not sure) and three left it empty.

ABCDE
1NameRatingCountingAnswer
2Amira8Anything (COUNTA)7
3Benn/aNumbers (COUNT)5
4Cara6Text (COUNTA − COUNT)2
5DevText (COUNTIF "*")2
6Ewa9Empty (COUNTBLANK)3
7Finnnot sure
8Gita7
9Hana
10Ivan5
11Jo
E4 holds =COUNTA(B2:B11)-COUNT(B2:B11). The answers fit together: 5 numbers + 2 text + 3 empty = 10 people.
  1. Anything: 5 numbers and 2 bits of text is 7 cells with something in. =COUNTA(B2:B11) gives 7.
  2. Numbers: =COUNT(B2:B11) gives 5. COUNT skips text.
  3. Text: 7 − 5 = 2. That's =COUNTA(B2:B11)-COUNT(B2:B11).
  4. Empty: =COUNTBLANK(B2:B11) gives 3.

Text only: COUNTIF with *

In COUNTIF, * means "any text". So =COUNTIF(B2:B11,"*") counts the cells with text in them and skips numbers and empty cells. It gives 2, the same as COUNTA minus COUNT. A number never matches "*", even a long one.

Cells that contain a word

Put words round the * to count cells that contain them. Here are the comments from the same away day. Which ones mention "late"? Lunch was late, Started late and Late finish: 3. Capitals don't matter, so "Late" counts. "late*" with no star in front only finds cells that start with late, so it gives 1.

ABCDE
1NameCommentCount the comments thatCount
2AmiraRoom too coldhave any text7
3BenLunch was latecontain late3
4CaraGreat daycontain cold2
5Devstart with late1
6EwaStarted late
7FinnToo cold by 3pm
8GitaLate finish
9HanaGood speaker
Column E holds, from the top: =COUNTIF(B2:B9,"*"), =COUNTIF(B2:B9,"*late*"), =COUNTIF(B2:B9,"*cold*") and =COUNTIF(B2:B9,"late*").

Watch for words inside other words: "*late*" would also count "chocolate". To use a word typed in a cell, such as H1, join the stars on: =COUNTIF(B2:B9,"*"&H1&"*"). To mark each matching row with a word or a tick, see if a cell contains text.

Cells that aren't empty, and response rates

COUNTA is the quickest way to count cells with anything in them, and =COUNTIF(B2:B11,"<>") does the same thing. A response rate is the people who answered divided by everyone. In the worked example, 7 of the 10 answered, so 7 ÷ 10 = 70%.

ABCDE
1NameRating
2Amira8Answered7
3Benn/aAsked10
4Cara6Response rate70%
5Dev
6Ewa9
7Finnnot sure
8Gita7
9Hana
10Ivan5
11Jo
E4 holds =COUNTA(B2:B11)/COUNTA(A2:A11), formatted as a percentage. Column A counts everyone asked, because every row has a name.

Cells that only look empty

A formula that shows nothing, such as =IF(B2="","",B2*10), leaves a cell that looks empty. COUNTA still counts it, because the cell holds a formula. COUNTBLANK counts it as empty too, so the two can add up to more than the number of cells. Here, 5 cells give a COUNTA of 5 and a COUNTBLANK of 2.

ABCDEF
1NameRatingPointsCountingAnswer
2Amira880COUNTA5
3BenCOUNTBLANK2
4Cara660COUNT3
5Dev770Not showing empty3
6Ewa
C2 holds =IF(B2="","",B2*10), copied down. Column F holds, from the top: =COUNTA(C2:C6), =COUNTBLANK(C2:C6), =COUNT(C2:C6) and =SUMPRODUCT(--(C2:C6<>"")).

To count only the cells that show something, use =SUMPRODUCT(--(C2:C6<>"")). C2:C6<>"" is TRUE for each cell that isn't showing empty, the -- turns TRUE into 1, and SUMPRODUCT adds them: 3. COUNTIF with "*" counts those cells as text too, while "?*" needs at least one character, so it skips them. A cell with only a space in it also looks empty but counts in COUNTA. Click the cell and look in the formula bar to see what's there.

Text in one group only

COUNTIFS adds a condition. To count the text answers from the Sales team only, pair the Team column with "Sales" and the Rating column with "*". In this list, Sales has 4 people, and 2 of them wrote text.

ABCDEF
1NameTeamRatingCountAnswer
2AmiraSales8Sales, text2
3BenSalesn/aSales, numbers2
4CaraSupport6Support, empty2
5DevSalesnot sure
6EwaSupport
7FinnSales7
8GitaSupport?
9HanaSupport
Column F holds, from the top: =COUNTIFS(B2:B9,"Sales",C2:C9,"*"), =COUNTIFS(B2:B9,"Sales",C2:C9,">=0") and =COUNTIFS(B2:B9,"Support",C2:C9,"").

There's no "is a number" condition, so ">=0" counts the numbers of 0 or more. More on conditions in COUNTIF and COUNTIFS.

Common mistakes

COUNT gives 0 on a list of names

COUNT only counts numbers. For names and other text, use COUNTA.

COUNTA is one too high

A cell that looks empty might have a space in it, or a formula that shows nothing. COUNTA counts both, as above.

Numbers counted as text

Numbers pasted from another system are sometimes stored as text, so COUNT skips them and the text count is too high. Usually they sit on the left of the cell, with a green triangle in the corner. See numbers stored as text.

Counting the heading

=COUNTA(B:B) on the whole column counts the heading in B1 too. Start the range on row 2, or take 1 away.

Counting different values

COUNTA counts every filled cell, so a name listed three times counts 3 times. To count each name once, see counting unique values.

Try it now

Your turn

In H1, count how many people wrote text in column C instead of giving a number.

ABCDEFGH
1EmployeeComing to the away day?Rating out of 10Wrote text
2ChenYes4
3RachelMaybenot sure
4SunilYesnot sure
5BenNo2
6AlexNon/a
7GraceYes8
8Nia
9TomYes9
10EllaMaybe?
11OwenNo7
12PriyaYes
13WillMaybe6
14LucyNon/a
15DevYes10
16Hana
17SamYes5
18FemiMaybedepends
19KerryNo3
20ZoeYes7
21Ivan

Open this in Try a formula: the same sheet with the answer filled in, to change or share by link.

Part of IF and COUNTIF practice: every lesson on the topic, with a project in Excel.

Where it works

COUNT, COUNTA, COUNTBLANK and COUNTIF work in every version of Excel, on Windows and Mac, and in Excel for the web. COUNTIFS needs Excel 2007 or later.

Questions

How do I count cells that contain any text in Excel?

Use =COUNTIF(B2:B50,"*"). The star stands for any text, so every cell with text in it is counted, and numbers, dates and empty cells are left out. =COUNTA(B2:B50)-COUNT(B2:B50) gives the same answer by counting everything and taking away the numbers.

How do I count cells that contain specific text?

Put stars either side of the word: =COUNTIF(B2:B50,"*late*") counts every cell with "late" anywhere in it, in capitals or not. Leave out the first star to count cells that start with the word, or the last one for cells that end with it. Without any stars, COUNTIF only counts cells that hold exactly that word and nothing else.

How do I count cells that are not blank?

Use =COUNTA(B2:B50), which counts every cell with something in it: text, numbers, dates and formulas. =COUNTIF(B2:B50,"<>") does the same. Both count a formula that shows nothing, because the cell isn't really empty. To count only the cells that show something, use =SUMPRODUCT(--(B2:B50<>"")).

Why does COUNTA count cells that look empty?

Something is in them that you can't see. Usually it's a formula that shows nothing, such as =IF(A2="","",A2), a space typed by mistake, or an empty text value left behind by pasting. Click the cell and look in the formula bar. Clear the cells that should be empty, or count with =SUMPRODUCT(--(B2:B50<>"")), which skips cells that show nothing.