ExcelReady
CourseMock testsFunction guidesBlog
Start freeStart learning for free
ExcelReady

Be Excel-ready before day one. Hands-on practice in your browser, with instant feedback.

Learn

  • Course
  • Mock tests
  • Function guides
  • Blog

Test prep

  • Excel level test
  • Excel test practice
  • Free screening quiz
  • Certificate

Company

  • Editorial policy
  • Contact
  • Terms
  • Privacy

© 2026 ExcelReady. All rights reserved.

  1. Blog
  2. Conditional math
  3. How to Count Cells With Text in Excel

How to Count Cells With Text in Excel

By ExcelReady Team·Updated November 1, 2026·6 min read

The short answer

To count cells that contain text in Excel, use COUNTIF with an asterisk: =COUNTIF(B2:B8,"*"). The * wildcard matches any text, so numbers, dates and blank cells are not counted. COUNTA is different: it counts every cell that isn't empty, numbers included. To count one specific word, put it in quotes: =COUNTIF(B2:B8,"Yes").

Key takeaways

  • =COUNTIF(range,"*") counts text cells and skips numbers, dates, logical values and blanks.
  • COUNTA counts every non-empty cell, so it includes numbers; COUNTA minus COUNT is a rough text count.
  • "?*" counts cells with at least one character, which leaves out empty text from formulas.
  • Numbers stored as text and cells holding only a space are counted as text.
  • For a specific word use =COUNTIF(range,"word"), and for partial matches use "word".
On this page+
  1. The sample data
  2. How to count cells with any text
  3. COUNTA, COUNT and COUNTIF compared
  4. How to count cells with specific text
  5. Cells that look empty but count as text
  6. Counting text with ISTEXT and SUMPRODUCT
  7. Numbers stored as text
  8. How to count text cells that meet another condition
  9. Practise it

To count cells with text in Excel, use =COUNTIF(range,"*"). The asterisk is a wildcard that matches any text, so the formula counts words and skips numbers, dates and empty cells. This guide compares it with COUNTA and ISTEXT, shows how to count a specific word, and explains the cells that look empty but still count.

The sample data#

Every example uses this survey column in A1:B8. It mixes words, numbers and one blank cell, which is exactly where the different counting functions disagree:

AB
1RespondentAnswer
2R1Yes
3R242
4R3
5R4No
6R5N/A
7R615
8R7Maybe

There are seven answer cells: four hold text (Yes, No, N/A, Maybe), two hold numbers (42 and 15) and one is blank. "N/A" here is typed text, not the #N/A error.

How to count cells with any text#

Use COUNTIF with a single asterisk as the criteria. COUNTIF counts the cells in a range that match a condition, and "*" means "any text, of any length":

Excel formula
=COUNTIF(B2:B8,"*")
  1. Click an empty cell, such as D2.
  2. Type =COUNTIF(B2:B8,"*").
  3. Press Enter.

The result is 4. The numbers 42 and 15 are left out because wildcards only match text, and the blank cell is left out because it holds nothing. Dates are numbers in Excel, so they are skipped too, and so are the logical values TRUE and FALSE. For the basics of COUNTIF, see how to use COUNTIF or the COUNTIF function guide.

COUNTA, COUNT and COUNTIF compared#

Excel has several counting functions, and each one answers a different question. On the same column:

FormulaWhat it countsResult
=COUNTIF(B2:B8,"*")Text cells4
=COUNTA(B2:B8)Every non-empty cell6
=COUNT(B2:B8)Numbers and dates2
=COUNTBLANK(B2:B8)Empty cells1
=COUNTA(B2:B8)-COUNT(B2:B8)Non-empty cells that aren't numbers4

COUNTA is the one people often reach for by mistake. It counts anything that isn't empty, so it includes the two numbers and gives 6. Use it when you want "how many answers were given", and COUNTIF with "*" when you want "how many answers were words". The COUNTA function guide and the lesson on COUNT and COUNTA cover the differences in more depth.

COUNTA - COUNT gives the same 4 here, but it also counts errors and TRUE/FALSE values, so it is only a rough text count. COUNTIF with "*" is more precise.

How to count cells with specific text#

To count one particular word, put it in quotes as the criteria:

QuestionFormulaResult
Answered Yes=COUNTIF(B2:B8,"Yes")1
Answered No=COUNTIF(B2:B8,"No")1
Text other than N/A=COUNTIF(B2:B8,"*")-COUNTIF(B2:B8,"N/A")3
Contains the letter a=COUNTIF(B2:B8,"*a*")2

COUNTIF ignores capitals, so "yes" and "YES" match "Yes". The pattern "*a*" finds N/A and Maybe, because each contains an a somewhere. Partial matches are covered in COUNTIF contains text, and counting yes/no answers in how to count Yes, No and ticks.

Cells that look empty but count as text#

Two kinds of cell look blank but still count as text:

  • A cell holding a space. A stray space typed by mistake is text, so "*" counts it. Select the cell and look at the formula bar, or check its length with =LEN(B4). A result of 1 or more means something is there.
  • A formula that returns empty text. A formula such as =IF(A2="","",A2) shows nothing when A2 is empty, but the cell holds empty text (""). COUNTIF with "*" and ISTEXT can count these cells too.

To skip empty text, use "?*" instead. The ? wildcard means exactly one character, so "?*" means "at least one character":

Excel formula
=COUNTIF(B2:B8,"?*")

On the sample data it also returns 4, because none of the cells holds empty text. On a sheet full of formulas, the two counts can differ. To find cells that are truly empty versus filled, see COUNTIF not blank.

Counting text with ISTEXT and SUMPRODUCT#

ISTEXT returns TRUE when a cell holds text and FALSE otherwise. Combined with SUMPRODUCT, it gives a text count without wildcards:

Excel formula
=SUMPRODUCT(--ISTEXT(B2:B8))

ISTEXT checks each cell, -- turns TRUE and FALSE into 1 and 0, and SUMPRODUCT adds them up. The result is 4. This form is useful when you want to combine the text test with another condition, such as =SUMPRODUCT(ISTEXT(B2:B8)*(A2:A8<>"R7")), which returns 3.

Numbers stored as text#

A number typed with an apostrophe, like '42, or imported from another system can be stored as text. Excel then counts it as text, not as a number. The cell usually sits on the left side of the column and may show a small green triangle in the corner.

That changes your counts: COUNTIF with "*" goes up, COUNT goes down, and SUM ignores the value. If a text count seems too high, look for numbers stored as text and convert them with VALUE or the Convert to Number option on the warning icon.

When your next question is how many different values a column holds, or how many repeat, read how to count unique values and how to count duplicates.

How to count text cells that meet another condition#

To count text cells in one group only, use COUNTIFS with "*" as one of the criteria. If column C held each respondent's region, this would count the North respondents who gave a text answer:

Excel formula
=COUNTIFS(B2:B8,"*",C2:C8,"North")

A row counts only when both conditions are TRUE. Another common job is counting text answers for every question in a survey, one column per question. Put =COUNTIF(B$2:B$8,"*") under the first question and fill it right (Windows: Ctrl+R; Mac: ⌘R). The $ before each row number keeps rows 2 to 8 fixed while the column letter changes to C, D and so on.

Practise it#

Choosing the right counting function is a classic screening-test question. Practise COUNTIF in a live spreadsheet, including wildcards, and then compare it with COUNT and COUNTA in the COUNT and COUNTA lesson. Each lesson checks your formula instantly.

Try it yourself

This is a live spreadsheet. Type the formula in the green cell and press Enter.

The Answer column mixes words, numbers and a blank. In D2, use COUNTIF with a wildcard to count only the cells in B2:B8 that contain text.

fx
ABCDE
1
Respondent
Answer
2
R1
Yes
Text cells
3
R2
42
4
R3
5
R4
No
6
R5
N/A
7
R6
15
8
R7
Maybe
9
10
11

Tip: The criteria is a single asterisk in double quotes. It matches any text.

Practise this in a lesson

LessonCOUNTIFCount the cells that match a condition, from exact words to number checks like ">=8".LessonCOUNT, COUNTA and COUNTBLANKCount numbers, filled cells and empty cells, a quick way to audit data.Function guideCOUNTIFCount cells that match one condition with COUNTIF: text, numbers, wildcards and cell references. Real examples and a live exercise.Function guideCOUNTAUse COUNTA to count non-empty cells in Excel. Learn how it differs from COUNT, what it secretly counts, and try a live exercise.

Frequently asked questions

How do I count cells with any text in Excel?

+

Use =COUNTIF(B2:B8,"*"). The asterisk matches any text, so the formula counts every text cell and skips numbers, dates and blank cells.

What is the difference between COUNTA and COUNTIF with an asterisk?

+

COUNTA counts every cell that isn't empty, including numbers, dates and errors. COUNTIF with "*" counts only cells that hold text.

How do I count cells with specific text?

+

Put the text in double quotes as the criteria: =COUNTIF(B2:B8,"Yes"). COUNTIF ignores capitals, so yes and YES count too. Use "Yes" to count cells that contain the word anywhere.

Why does my text count include cells that look empty?

+

Those cells probably hold a space or a formula that returns empty text (""). Both count as text. Use "?" instead of "" to skip empty text, and clean stray spaces with TRIM.

How do I count cells that are not text?

+

Use COUNT for numbers and dates: =COUNT(B2:B8). To count every non-empty cell that is not text, subtract: =COUNTA(B2:B8)-COUNTIF(B2:B8,"*").

Sources

  • COUNTIF function - Microsoft Support
  • COUNTA function - Microsoft Support
  • IS functions - Microsoft Support

Written and checked by the ExcelReady Team. First published November 1, 2026. The practice exercise runs in the same formula engine as our lessons. Found a mistake? Read our editorial policy or email hello@excelready.app.

On this page

  1. The sample data
  2. How to count cells with any text
  3. COUNTA, COUNT and COUNTIF compared
  4. How to count cells with specific text
  5. Cells that look empty but count as text
  6. Counting text with ISTEXT and SUMPRODUCT
  7. Numbers stored as text
  8. How to count text cells that meet another condition
  9. Practise it

Keep reading

Conditional math· 6 min read

Count Non-Blank Cells With a Condition in Excel

To count cells that are not blank, use =COUNTIF(C2:C8,"<>"), where "<>" means "not equal to nothing". To add a condition, use COUNTIFS: =COUNTIFS(B2:B8,"Sales",D2:D8,"<>") counts Sales rows whose column D is filled in. Use "" instead of "<>" to count the blank ones. COUNTA also counts non-blank cells, but takes no condition.

Conditional math· 6 min read

How to Count Unique Values in Excel

In Excel 2021 and Microsoft 365, count unique values with =COUNTA(UNIQUE(B2:B11)): UNIQUE lists each different value once and COUNTA counts the list. Add a condition with FILTER, as in =COUNTA(UNIQUE(FILTER(B2:B11,C2:C11="East"))). In older Excel, use =SUMPRODUCT(1/COUNTIF(B2:B11,B2:B11)) instead.

Conditional math· 6 min read

How to Count Duplicates in Excel

To count duplicates in Excel, use COUNTIF. =COUNTIF($A$2:$A$8,A2) shows how many times the value in A2 appears; any result above 1 is a duplicate. To count every row that is part of a duplicate set in one cell, use =SUMPRODUCT(--(COUNTIF(A2:A8,A2:A8)>1)). Decide first whether you need repeated rows, extra copies or repeated values.

Don't just read about Excel. Do it.

Practise real formulas in a live spreadsheet with instant feedback, right in your browser. Nothing to download.

Start learning for free