To count the cells in a range that hold numbers, type =COUNT(C2:C11). COUNT skips text, blanks and errors. To count every cell that is not empty, use =COUNTA(C2:C11). To count the empty ones, use =COUNTBLANK(C2:C11). Pick the function by what you want to count, not by what the column looks like.
Functions
Excel COUNT Function: COUNT, COUNTA and COUNTBLANK
Try this now
Why? Because exactly 4 cells in the range A2 through E2 contain numbers. The COUNT function is counting them, not summing them.
Type the formula below. Remember to start the formula with an equals sign
= and to enclose the function inputs in opening and closing parentheses ( ).| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | |||||
| 2 | 15 | 9 | 16 | 2 | |
| 3 | |||||
| 4 | |||||
| 5 |
Ready to practice?
Apply what you just learned with interactive exercises.
This page uses one delivery log to show how each function behaves, why COUNT returns less than you expect on a messy column, how to count cells with text, how to count characters and letters in a cell, and how to count unique values.
TL;DR
- =COUNT(range) counts numbers and dates only. Text, blanks, TRUE/FALSE and errors inside the range are skipped.
- =COUNTA(range) counts everything that is not empty, including text, errors and cells that look empty but hold a formula returning "".
- =COUNTBLANK(range) counts empty cells and cells whose formula returns "".
- To count cells with text, use =COUNTIF(range,"*"). To count characters in a cell, use =LEN(cell).
- A number stored as text is invisible to COUNT. If COUNT and COUNTA disagree and you expected them to match, look for text numbers first.
Table of Contents
- Sample data: a delivery log
- COUNT syntax
- How to count cells with numbers
- How to count cells that are not blank
- How to count blank cells
- How to count cells with text
- Why COUNT misses numbers stored as text
- How to count characters, letters and symbols in a cell
- How to count unique values
- COUNT compared with its neighbors
- Excel versions
- Common errors and wrong results
- What learners get wrong
- Job scenario: a weekly delivery report
- Practice
- FAQ
- Sources
Sample data: a delivery log
Every example below uses this table. Row 1 holds the headings and the data sits in rows 2 to 11. Column A holds a delivery reference, B the driver, C the parcels delivered and D the date delivered.
| Row | A: Ref | B: Driver | C: Parcels | D: Delivered |
| 2 | R-101 | Thabo | 24 | 2026-10-05 |
| 3 | R-102 | Lerato | 31 | 2026-10-05 |
| 4 | R-103 | Thabo | (empty) | (empty) |
| 5 | R-104 | Sipho | n/a | 2026-10-06 |
| 6 | R-105 | Lerato | 18 | 2026-10-06 |
| 7 | R-106 | Sipho | 27 | 2026-10-07 |
| 8 | R-107 | Thabo | 0 | 2026-10-07 |
| 9 | R-108 | Lerato | 22 | (empty) |
| 10 | R-109 | Sipho | 15 | 2026-10-08 |
| 11 | R-110 | Thabo | 30 | 2026-10-08 |
COUNT syntax
The pattern is =COUNT(value1, [value2], ...). The brackets mean the argument is optional.
| Argument | Required? | What it does |
| value1 | Required | The first cell, range or value to look at. |
| value2, ... | Optional | More cells, ranges or values. Excel accepts up to 255 arguments in total. |
How to count cells with numbers
Use =COUNT(C2:C11) to count the numeric cells in the Parcels column. It returns 7.
Why 7 and not 10? Walk down column C. The numbers are 24, 31, 18, 0, 22, 15 and 30. That is seven. The empty cell C4, the text n/a in C5 and the text-number in C7 are all skipped. The zero in C8 counts, because zero is a number.
COUNT also counts dates. =COUNT(D2:D11) returns 8, one for every filled date, because Excel stores a date as a serial number. You can count across a block too: =COUNT(A2:D11) returns 15. Columns A and B are all text, so only the 7 numbers in C and the 8 dates in D count.
You can give COUNT several ranges. =COUNT(C2:C11,D2:D11) returns 15, the same total, with the two ranges added together.
Numbers you type directly into the formula follow different rules from numbers inside a range. =COUNT(1,"7","a",TRUE) returns 3. The typed 1 counts, the typed text "7" is converted and counted, and the typed TRUE counts. Only the "a" is skipped. If the same TRUE or "7" sat inside a cell in a range, it would be ignored. Microsoft documents this split in its page for COUNT, linked in the sources.
How to count cells that are not blank
Use =COUNTA(C2:C11) to count every cell in C2:C11 that holds anything. It returns 9, because only C4 is empty.
COUNTA counts numbers, text, TRUE and FALSE, and error values. It treats n/a and the text-number 27 as full cells. To count how many deliveries are logged at all, use the reference column: =COUNTA(A2:A11) returns 10.
One catch matters on real workbooks. A cell with a formula that returns an empty string, such as ="", looks empty but COUNTA still counts it, because the cell is not truly empty. If you see a COUNTA total higher than the number of visible entries, hunt for formulas that return "".
The status bar gives you a free version of this. Select a range and look at the bottom right of the Excel window. Count there is the same as COUNTA, and Numerical Count is the same as COUNT. If you right-click the status bar you can switch them on or off.
How to count blank cells
Use =COUNTBLANK(C2:C11) to count empty cells. It returns 1, for C4.
For the Delivered column, =COUNTBLANK(D2:D11) returns 2, for D4 and D9. These two rows are the deliveries with no date.
COUNTBLANK counts a cell as blank when it is truly empty or when its formula returns an empty string. That is the opposite of COUNTA, which counts the formula cell as full. So a column with ten rows can have COUNTA + COUNTBLANK add up to more than ten if some cells hold "" formulas. They are counted twice, once by each function.
COUNTBLANK does not treat a cell with a single space as blank. A space is a character. If a column looks empty and COUNTBLANK says 0, click one of the cells and check the formula bar.
How to count cells with text
Use =COUNTIF(C2:C11,"*") to count cells in C2:C11 that contain text. It returns 2, for n/a in C5 and the text-number in C7. The * is a wildcard that means any text of any length. Numbers and empty cells do not match it. The wildcard characters guide covers *, ? and ~ in full.
A second way to get the same answer is =SUMPRODUCT(--ISTEXT(C2:C11)), which also returns 2. ISTEXT checks each cell and returns TRUE or FALSE, the double minus turns those into 1 and 0, and SUMPRODUCT adds them. It is longer, but it never depends on wildcard rules.
For the driver names, =COUNTIF(B2:B11,"*") returns 10, because every driver cell holds text.
Three small details change the answer:
- "*" also matches a formula that returns an empty string. To count only cells with at least one visible character, use =COUNTIF(B2:B11,"?*").
- If you want a count of cells that contain a piece of text, put the piece between asterisks. =COUNTIF(B2:B11,"*ab*") returns 4, because "Thabo" contains "ab" and the other names do not.
- To count one exact word, skip the wildcard. =COUNTIF(B2:B11,"Thabo") returns 4. COUNTIF ignores upper and lower case, so "thabo" gives the same answer.
Why COUNT misses numbers stored as text
A number stored as text is the main reason COUNT returns a smaller number than you expect. In the delivery log, C7 shows 27 but COUNT will not count it.
You can spot the problem in three ways. First, the number is left-aligned in a column where the others are right-aligned. Second, a small green triangle may sit in the corner of the cell. Third, COUNT and COUNTA disagree on a column you thought was all numbers: =COUNTA(C2:C11)-COUNT(C2:C11) returns 2, which is the number of cells holding text rather than numbers.
To find only the text that could be converted to a number, use =SUMPRODUCT(--ISTEXT(C2:C11),--ISNUMBER(--C2:C11)). It returns 1, for C7. The text n/a fails the conversion and is not counted.
To fix a single cell, use =VALUE(C7), which returns 27, or =--C7, which does the same thing. To fix a whole column, select it, open the Data tab, choose Text to Columns and press Finish without changing anything. Excel reconverts every cell in the selection. After the fix, =COUNT(C2:C11) returns 8, because C7 now counts.
The reverse trap exists as well. Numbers with a leading apostrophe, numbers imported from a web page and numbers exported from some accounting tools often arrive as text. Always compare COUNT with COUNTA before you trust a total.
How to count characters, letters and symbols in a cell
COUNT counts cells. To count characters inside a cell, you need a different function: LEN. The LEN function guide has more cases. These are the common cases.
Count characters in one cell. =LEN(B2) returns 5, because "Thabo" has five letters. LEN counts spaces and punctuation as characters too. =LEN(A2) returns 5 for "R-101".
Count characters in a range. =SUMPRODUCT(LEN(B2:B11)) returns 53. It measures every cell and adds the lengths. Thabo appears four times at 5 characters, Lerato three times at 6 and Sipho three times at 5, which is 20 + 18 + 15.
Count one letter in a cell. Take the length of the text, then subtract the length with that letter removed. =LEN(B2)-LEN(SUBSTITUTE(B2,"a","")) returns 1, because "Thabo" has one "a". SUBSTITUTE is case-sensitive, so a capital "A" would not be removed. To ignore case, convert first with LOWER: =LEN(B2)-LEN(SUBSTITUTE(LOWER(B2),"a","")). Read more about it in the SUBSTITUTE guide.
Count one letter across a range. =SUMPRODUCT(LEN(B2:B11)-LEN(SUBSTITUTE(B2:B11,"a",""))) returns 7. Thabo has one "a" and appears four times, Lerato has one and appears three times, Sipho has none.
Count symbols. The same pattern works for any symbol, including a hyphen. =LEN(A2)-LEN(SUBSTITUTE(A2,"-","")) returns 1, and =SUMPRODUCT(LEN(A2:A11)-LEN(SUBSTITUTE(A2:A11,"-",""))) returns 10, one hyphen per reference code.
To count a longer piece of text instead of a single character, divide by its length. If you search for "ab", divide the difference by LEN("ab").
How to count unique values
The unique drivers in B2:B11 are Thabo, Lerato and Sipho, so the answer is 3. There are two good ways to get it.
In Microsoft 365 and Excel 2021 or later, use =COUNTA(UNIQUE(B2:B11)). UNIQUE returns the distinct names and COUNTA counts them. It returns 3.
In older versions, use =SUMPRODUCT(1/COUNTIF(B2:B11,B2:B11)). Each name gets a weight of one divided by how often it appears, so the weights for each name add up to exactly 1. It also returns 3.
The older formula breaks on blank cells. If the range includes an empty cell, COUNTIF returns 0 for it and the formula divides by zero. Trim the range to filled cells or use the UNIQUE version. The count unique values guide covers blanks, case and multiple columns.
COUNT compared with its neighbors
Use the table to pick the right function for the job.
| Function | Counts | Skips | On column C returns |
| COUNT | Numbers and dates | Text, blanks, errors, TRUE/FALSE in ranges | 7 |
| COUNTA | Anything not empty | Truly empty cells | 9 |
| COUNTBLANK | Empty cells and "" results | Cells with any content | 1 |
| COUNTIF | Cells meeting one condition | Cells that do not match | Depends on the condition |
| COUNTIFS | Rows meeting several conditions | Rows that fail any one | Depends on the conditions |
| SUMPRODUCT with ISTEXT | Cells you test with your own rule | Whatever your test rejects | 2 for text cells |
| SUBTOTAL(102 or 103) | Visible cells only | Hidden and filtered rows | 7 for 102, 9 for 103 |
Excel versions
COUNT, COUNTA, COUNTBLANK, COUNTIF and LEN exist in every version of Excel you are likely to meet, including Excel 2010, 2013, 2016, 2019, 2021, Microsoft 365, Excel for the web and Excel for Mac. They behave the same way in each.
UNIQUE is newer. It works in Excel 2021, Microsoft 365 and Excel for the web, and it does not exist in Excel 2019 or earlier. If you share a workbook with someone on an older version, use the SUMPRODUCT pattern from the unique section so they see a number instead of #NAME?. Excel for the web and Excel for Mac support the dynamic array functions that come with these newer versions.
Common errors and wrong results
COUNT itself rarely errors. The mistakes are mostly wrong answers that look right.
| What you see | Cause | Fix |
| =COUNT(C2:C11) returns 7 when you expected 8 | One number is stored as text, such as C7 | Convert the cell with =VALUE(C7) or Text to Columns |
| =COUNT(B2:B11) returns 0 | The range holds only text, here the driver names | Use =COUNTA(B2:B11) or =COUNTIF(B2:B11,"*") |
| COUNTA returns more than the visible entries | Some cells hold a formula that returns "" | Count with =COUNTIF(range,"?*") or clear the formulas |
| #NAME? | The function name is misspelled, or UNIQUE is not in your version | Check the spelling, or use the SUMPRODUCT pattern |
| #DIV/0! | =SUMPRODUCT(1/COUNTIF(B2:B12,B2:B12)) over a range with an empty cell, such as B12 | Trim the range to B2:B11 or use UNIQUE |
| A warning about a circular reference | The COUNT formula sits inside the range it counts | Move the formula outside the range |
| #REF! | The column you were counting was deleted | Restore the column or rewrite the range |
What learners get wrong
Between 26 September and 3 November 2026, learners made 3,352 first attempts across our COUNT Function lesson, and 81.1% were right. Across the COUNT Skill Summary, there were 2,464 first attempts and 72.7% were right. A first attempt is the first check of a screen in a page view, not a person. The hardest screens show four patterns.
Counting a text column. On the summary screen that asks for the number of planets, only 33.7% of 252 first attempts were right. The most common wrong answer, with 108 first attempts, was =COUNT(A2:A8). Column A holds the planet names, which are text, so COUNT returns 0. The accepted answer points COUNT at a numeric column, such as =COUNT(B:B). Another 65 first attempts used =COUNT(A:A), which fails for the same reason. Rule: COUNT counts numbers, so aim it at numbers. To count names, use COUNTA.
Typing a formula when the screen wants a number. On a screen asking what a COUNT would return, only 52.5% of 360 first attempts were right. The top wrong answer, with 74 first attempts, was the formula =COUNT(A1:A5). The screen wanted the result, 3. If a question says "what would this return", type the value.
A range that is one column too wide. The question asked for the months Chuck made a sale from January through March. The accepted answers are =COUNT(B4:D4) and =COUNT(A4:D4). The wrong =COUNT(B4:E4) appeared 25 times in 331 first attempts, 68.3% of which were right, because it reaches one column past March. The whole-row =COUNT(4:4) appeared 12 times and =COUNT(B2:D5), which counts four rows instead of one, appeared 12 times. Select only the cells the question names.
The header row counts as text. On the screen asking what =COUNTIF(A:A,"*") returns, the answer is 8: seven planets plus the heading in A1. Only 46.9% of 241 first attempts were right. A whole-column reference includes the header, and a heading is text. Fix: use A2:A8, or subtract 1 for the header.
On the summary's COUNTIFS screen, the most common miss was a dropped digit, "<2000" for "<20000", which happened 18 times. Read your criteria out loud before you press Enter.
Job scenario: a weekly delivery report
Your manager wants three numbers on Monday: how many runs were logged, how many were completed, and the average parcels per completed run. Use the delivery log above.
- Runs logged. =COUNTA(A2:A11) returns 10, one for every reference.
- Runs completed. A run is completed when it has a delivery date, so use =COUNT(D2:D11), which returns 8. Runs still open are =COUNTBLANK(D2:D11), which returns 2. The completion rate is =COUNT(D2:D11)/COUNTA(A2:A11), which returns 0.8.
- Check the parcel column before averaging. =COUNTA(C2:C11)-COUNT(C2:C11) returns 2, so two filled cells are not numbers. One is n/a, which is correct. The other is the text 27 in C7, which is a mistake.
- Fix and average. Convert C7 to a real number. Now =COUNT(C2:C11) returns 8 and =AVERAGE(C2:C11) returns 20.875. Before the fix, AVERAGE would have ignored C7 and returned a figure based on 7 cells, which understates the day. The AVERAGE guide covers what it skips.
Practice
Open Practice Lesson 25 and type each formula rather than reading it. Then try Practice Lesson 28, the COUNT skill summary, which mixes COUNT, COUNTIF and COUNTIFS on one table. For more of the family in one place, keep the Excel functions cheat sheet open beside you.
A good drill: in a blank sheet, type five numbers, two words and leave one cell empty. Predict what COUNT, COUNTA and COUNTBLANK return before you press Enter, then check. If you were wrong, work out which cell fooled you.
FAQ
How do I count cells with text in Excel?
Use =COUNTIF(C2:C11,"*"). The asterisk matches any text, so the formula counts every cell in the range that holds text and skips numbers and empty cells. To count cells that contain a specific word, put it between asterisks, such as "*invoice*". For text that must have at least one character, use "?*".
What is the difference between COUNT and COUNTA?
COUNT counts only numbers and dates. COUNTA counts every cell that is not empty, including text, TRUE or FALSE, and errors. On a column of ten entries where seven are numbers, COUNT returns 7 and COUNTA returns 10. Use COUNT for numeric data and COUNTA to count how many entries exist.
How do I count characters in an Excel cell?
Use =LEN(B2). It returns the number of characters in the cell, including spaces and punctuation. To total characters across a range, wrap it in SUMPRODUCT: =SUMPRODUCT(LEN(B2:B11)). To count one letter or symbol, subtract the length of the text with that character removed using SUBSTITUTE.
How do I count cells that are not blank?
Use =COUNTA(C2:C11). It counts every cell with anything in it. One caution: a formula that returns an empty string counts as not blank. To count only cells with visible content, use =COUNTIF(B2:B11,"?*") for text or =COUNT(C2:C11) for numbers. If the answer looks too high, check for hidden "" formulas.
Why does COUNT return 0 for a column that has numbers?
The numbers are probably stored as text. COUNT skips text, even when it looks like a number. Check for left-aligned values or green triangles in the corners. Select the column, use Data, then Text to Columns, then Finish to convert them. Another cause is that the range points at a text column, such as names.
How do I count unique values in Excel?
In Microsoft 365 and Excel 2021 or later, use =COUNTA(UNIQUE(B2:B11)). In older versions, use =SUMPRODUCT(1/COUNTIF(B2:B11,B2:B11)), which fails if the range has blank cells. Both formulas treat "Thabo" and "thabo" as the same value, because they ignore case. Blank cells in the range need care: the older formula returns #DIV/0! on them.
Does COUNT include dates?
Yes. Excel stores dates as numbers, so COUNT counts every real date in the range. Dates typed as plain text, such as an imported "2026-10-05" that Excel did not convert, are not counted. A quick test: change the cell to General format. A real date turns into a number like 46300.
Sources
Keep going
Guides people read next.
Excel Count Characters in a Cell: LEN Function Guide
Count characters in an Excel cell with LEN, spaces included. Fix inflated counts with TRIM, count one letter or symbol, and total a whole range.
15 min
WEEKDAY Function in Excel: Syntax, Examples and Day Names
Learn how the Excel WEEKDAY function works, which return_type to pick, how to get day names, flag weekends and fix errors, with copy-ready formulas.
15 min
CHOOSECOLS Function in Excel: Syntax, Examples, Fixes
Learn how the Excel CHOOSECOLS function works, with CHOOSEROWS too: syntax, negative indexes, FILTER combos, version support and fixes for #VALUE! and #SPILL!.
16 min