Skip to content

All-Access: every lesson, no ads. $8.25€8.25US$8.25$4.08US$4.08$2.41US$2.41₹224.91MX$74.91 a month, billed yearly. Free to start. Cancel any time

See plans
All-Access, no ads: every lesson, course and template. $8.25€8.25US$8.25$4.08US$4.08$2.41US$2.41₹224.91MX$74.91 a month. + GST at checkoutSee the plans →

Functions

Excel COUNT Function: COUNT, COUNTA and COUNTBLANK

By the LogicExcel Editorial Team18 min read3,485 wordsPractice this

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.

Try this now

The COUNT function counts all the cells that contain numbers in a specified range of cells. Count the cells in A2:E2 to get a result of 4!

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 ( ).
ABCDE
1
2159162
3
4
5
A3fx

Continue the full lesson →

Ready to practice?

Apply what you just learned with interactive exercises.

Start Lesson 25

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

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.

RowA: RefB: DriverC: ParcelsD: Delivered
2R-101Thabo242026-10-05
3R-102Lerato312026-10-05
4R-103Thabo(empty)(empty)
5R-104Siphon/a2026-10-06
6R-105Lerato182026-10-06
7R-106Sipho272026-10-07
8R-107Thabo02026-10-07
9R-108Lerato22(empty)
10R-109Sipho152026-10-08
11R-110Thabo302026-10-08
Three cells are traps on purpose. C4 is empty because the run has not happened. C5 holds the text n/a. C7 holds 27, but it was pasted in from another system and Excel stores it as text, so it sits on the left of the cell instead of the right. The dates in column D are real dates, which means Excel stores them as numbers.

COUNT syntax

The pattern is =COUNT(value1, [value2], ...). The brackets mean the argument is optional.

ArgumentRequired?What it does
value1RequiredThe first cell, range or value to look at.
value2, ...OptionalMore cells, ranges or values. Excel accepts up to 255 arguments in total.
COUNT returns a whole number. It never returns an error because of what is inside the range: an error value in a cell is skipped, not passed on. The only errors you get come from a broken formula, such as a misspelled function name.

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.
For conditions beyond text, such as counting values above a number, go to the COUNTIF guide. To combine two conditions, use COUNTIFS.

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.

FunctionCountsSkipsOn column C returns
COUNTNumbers and datesText, blanks, errors, TRUE/FALSE in ranges7
COUNTAAnything not emptyTruly empty cells9
COUNTBLANKEmpty cells and "" resultsCells with any content1
COUNTIFCells meeting one conditionCells that do not matchDepends on the condition
COUNTIFSRows meeting several conditionsRows that fail any oneDepends on the conditions
SUMPRODUCT with ISTEXTCells you test with your own ruleWhatever your test rejects2 for text cells
SUBTOTAL(102 or 103)Visible cells onlyHidden and filtered rows7 for 102, 9 for 103
Use COUNT for numeric columns, COUNTA to count entries, COUNTBLANK to find gaps, COUNTIF when one condition decides, and COUNTIFS when two or more do. SUBTOTAL is the one to reach for on a filtered list. =SUBTOTAL(102,C2:C11) is COUNT that respects filters and hidden rows, and =SUBTOTAL(103,C2:C11) is COUNTA that does. Read the SUBTOTAL guide before you build a filtered report.

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 seeCauseFix
=COUNT(C2:C11) returns 7 when you expected 8One number is stored as text, such as C7Convert the cell with =VALUE(C7) or Text to Columns
=COUNT(B2:B11) returns 0The range holds only text, here the driver namesUse =COUNTA(B2:B11) or =COUNTIF(B2:B11,"*")
COUNTA returns more than the visible entriesSome 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 versionCheck 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 B12Trim the range to B2:B11 or use UNIQUE
A warning about a circular referenceThe COUNT formula sits inside the range it countsMove the formula outside the range
#REF!The column you were counting was deletedRestore 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.

  1. Runs logged. =COUNTA(A2:A11) returns 10, one for every reference.
  2. 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.
  3. 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.
  4. 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.
The empty parcel cell in C4 is a different case. It stays out of both COUNT and AVERAGE because the run has no count yet. A zero would pull the average down, so do not fill it with 0 unless the run really delivered nothing.

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.