Last updated July 2026. To count cells with text in Excel, use =COUNTIF(A2:A100,"*"). The asterisk is a wildcard that matches any text string, so the formula counts every cell holding text and ignores blank cells and pure numbers. To count all non-blank cells, text and numbers together, use =COUNTA(A2:A100) instead. Those two functions cover almost every real counting job on a converted file.
Counting cells sounds trivial until a converted PDF gives you a column that is part text, part numbers, part blank, and part cells that only look empty. Knowing which function to reach for, and why a count can come back higher than the rows you can see, is what keeps a reconciliation honest.
How do I count cells with text in Excel?
Use =COUNTIF(range, "*") to count every cell that contains text. The wildcard asterisk stands for any run of characters, so it catches names, labels, codes, and descriptions, while skipping numbers, dates, and truly empty cells. For a column of transaction descriptions in B2 to B500, =COUNTIF(B2:B500, "*") returns how many rows actually carry a description.
One subtlety matters after a conversion. The wildcard counts anything Excel treats as text, which includes numbers that got stored as text. If a converted amount column shows up in your text count, that is a red flag: those figures are text, not numbers, and they will not add up in a SUM or a pivot. In that sense COUNTIF with a wildcard doubles as a quick detector for the number-as-text problem.
How do I count non-blank cells in Excel?
Use =COUNTA(range) to count every cell that is not empty, whether it holds text, a number, a date, or an error. Where COUNTIF with a wildcard counts only text, COUNTA counts everything present. To count how many rows of a converted statement have any value at all in column A, =COUNTA(A2:A100) is the fastest answer.
The mirror image is COUNTBLANK. =COUNTBLANK(A2:A100) returns how many cells are empty, which is handy for spotting gaps a conversion left behind. COUNTA plus COUNTBLANK over the same range should equal the total number of cells; if it does not, something odd is in there, usually a formula returning an empty string.
| Goal | Formula | Counts |
|---|---|---|
| Cells with text | =COUNTIF(A2:A100,"*") | Text only (incl. text-numbers), skips real numbers and blanks |
| All non-blank cells | =COUNTA(A2:A100) | Text, numbers, dates, errors |
| Cells with numbers | =COUNT(A2:A100) | Real numbers and dates only |
| Blank cells | =COUNTBLANK(A2:A100) | Empty cells (and empty strings from formulas) |
| Strict text count | =SUMPRODUCT(--ISTEXT(A2:A100)) | Only genuine text, ignores wildcards entirely |
What formula counts cells that contain specific text?
Wrap the text you want in asterisks to count partial matches. =COUNTIF(B2:B500, "*invoice*") counts every cell that contains the word invoice anywhere in it, regardless of what surrounds it. Drop the asterisks, as in =COUNTIF(B2:B500, "invoice"), and you count only cells whose entire content is exactly the word invoice. That difference, contains versus equals, trips up a lot of counts.
COUNTIF ignores case, so "*invoice*" and "*INVOICE*" return the same result. If you need to count two conditions at once, switch to COUNTIFS: =COUNTIFS(A2:A100, "*", B2:B100, ">100") counts rows that have text in column A and a value over 100 in column B. That pattern is how you filter a converted register down to the rows that actually matter.
Why does my text count look too high?
A count that comes back higher than the visible rows almost always means invisible content is being counted. Three culprits show up on converted data: cells that hold only a space, cells that hold a non-breaking space (character 160, common from web and PDF sources), and formula cells that return an empty string. All three look blank but are not, so COUNTA and a wildcard COUNTIF both count them.
To count text while excluding cells that hold nothing but spaces, use =COUNTIFS(range, "*", range, "<> "). The cleaner long-term fix is to strip the stray characters at the source so every count agrees. Running the column through TRIM and a non-breaking-space substitute turns those fake-blank cells into genuine blanks, after which your counts line up with what you see.
How do I count only cells with numbers?
Use =COUNT(range). COUNT tallies only cells that hold real numbers or dates and ignores text and blanks entirely. This is the counterpart to the wildcard text count, and running both on the same converted column is a fast audit: if COUNT is lower than you expect and COUNTIF with a wildcard is higher, your numbers are stored as text and need converting before any math will work.
That pairing is genuinely useful on files that come out of document extraction. Software that reads documents and pulls the fields at scale can still hand back a mix of real and text numbers depending on the source quality, so a two-line count check catches the problem before it reaches a total.
How do I count only the visible cells after filtering?
COUNTA and COUNTIF count hidden rows too, so once you filter a converted register they overcount. To count only the rows a filter left visible, use =SUBTOTAL(3, range), where 3 is the function code for COUNTA. Filter your data to the vendor or month you care about, and =SUBTOTAL(3, A2:A1000) reports how many visible rows remain, updating live as you change the filter. This is the count you usually want when you are slicing a converted statement down to a subset.
SUBTOTAL has a companion for numbers: =SUBTOTAL(2, range) counts visible numeric cells, mirroring COUNT. Between the two you can audit a filtered view without ever unhiding the rows, which keeps a reconciliation honest when you are only looking at part of the data.
How do I count unique text values?
In Microsoft 365 and Excel 2021, =COUNTA(UNIQUE(range)) counts distinct entries: UNIQUE returns the list of unique values and COUNTA counts them. On older versions, =SUMPRODUCT(1/COUNTIF(range, range)) does the same for a range with no blanks, giving one for each distinct value. Counting unique vendors, categories, or account numbers in a converted file is often more useful than counting rows, because it tells you how many real entities the data covers.
Counting is usually step one of tidying a converted sheet. Once you know how many rows carry text, how many are blank, and how many numbers are secretly text, the next moves, filling gaps, removing duplicates, converting text to numbers, follow naturally. The full sequence lives in the guide to cleaning up data after a PDF conversion, and every clean count starts with a clean conversion from the PDF to Excel converter.