Field Guide

COUNT, COUNTA, and COUNTBLANK in Excel: which cells each one counts

Updated

COUNT, COUNTA, and COUNTBLANK all count cells, and each one counts a different set. COUNT(value1, [value2], ...) counts only the cells that hold numbers. COUNTA(value1, [value2], ...) counts every cell that is not empty, whatever it holds. COUNTBLANK(range) counts the empty cells. The catch that trips people is a cell whose formula returns an empty string: COUNTA reads it as filled, COUNTBLANK reads it as blank, so the same cell can land in both totals.

None of the three takes a condition. Counting only the cells that meet a rule is what COUNTIF and COUNTIFS do, and that is a separate job, covered in the COUNTIF and SUMIF guide.

What does each function count?

The three split the cells in a range into three overlapping groups.

Which cells does each one count?

Put a number, a piece of text, an empty cell, and a formula that returns an empty string in one column, and the three functions divide them up like this:

A B
1 Name Reply
2 Ada 42
3 Bo Pending
4 Cy
5 Di
B2 holds the number 42, B3 the text Pending, B4 is genuinely empty (Cy left it blank), and B5 shows nothing but holds a formula that returns an empty string. B4 and B5 look identical on screen, and that is exactly where COUNTA and COUNTBLANK disagree.

Run all three over B2:B5:

Formula Returns Which cells it counts
=COUNT(B2:B5) 1 only B2, the number 42
=COUNTA(B2:B5) 3 B2, B3, and B5 (the empty-string formula counts as filled)
=COUNTBLANK(B2:B5) 2 B4 and B5 (the empty-string formula counts as blank)

COUNT finds one number, so it returns 1. COUNTA finds three filled cells, the number, the text, and the formula in B5, so it returns 3. COUNTBLANK finds two blanks, the empty B4 and that same formula in B5, so it returns 2. Notice B5 sits in both the COUNTA total and the COUNTBLANK total: across four cells, 3 plus 2 comes to 5, because that one formula cell is counted on both sides.

Is a formula that returns nothing blank?

This is the distinction the two functions were built to disagree on. A cell whose formula produces an empty string shows nothing, but it is not empty, because a formula lives in it. Microsoft’s COUNTBLANK page is explicit: “Cells with formulas that return “” (empty text) are also counted. Cells with zero values are not counted.“ COUNTA takes the opposite view and counts that same cell as an entry.

=IF(ISBLANK(C5), "", C5)
A formula like this shows nothing when C5 is empty, so the cell looks blank. COUNTA counts it as filled; COUNTBLANK counts it as blank. The same cell is in both totals.

This matters when you build a report on top of such a column. If you count filled responses with COUNTA, the empty-string cells inflate the total; if you count the gaps with COUNTBLANK, they are treated as gaps. Decide which reading you want before you wire the count into anything downstream.

Why does COUNT come back lower than you expect?

Inside a range, COUNT counts real numbers and nothing else. That is usually what you want, but it becomes a trap when a column that looks fully numeric holds a few figures stored as text. Those text entries are not numbers to COUNT, so they drop out of the tally with no error, and the count reads lower than the rows on screen. It is the same reason a SUM can come out low, and there is a full guide to numbers stored as text. A quick tell: COUNT below COUNTA on a column that should be all numbers means some of those numbers are text.

One wrinkle applies here, though it rarely bites in practice. Values typed straight into the arguments follow a looser rule than values pulled from a range: a logical value or a number written as text does count when you type it directly, so =COUNT(TRUE, "1", 5) returns 3. Point COUNT at cells holding those same values and only the genuine number is counted. Because you almost always give COUNT a range, the range rule is the one that governs everyday use.

If the rows you are counting are filtered, a plain COUNT still counts the ones hidden by the filter. The filter-aware version is SUBTOTAL, whose function numbers 2 and 3 give you a COUNT and a COUNTA that follow the active filter, covered in the SUBTOTAL guide.

The short version

Frequently asked questions

What is the difference between COUNT and COUNTA in Excel?
COUNT counts only cells that contain numbers, so it passes over text, blanks, and error values inside the range you give it. COUNTA counts every cell that is not empty, whatever it holds: text, numbers, dates, error values, TRUE or FALSE, even a formula whose result is an empty string. On a column that should be all numbers, COUNT coming back below COUNTA means some entries are not real numbers.
What does COUNTA count in Excel?
COUNTA counts any cell that holds something, including text, numbers, dates, logical values, and error values, and it also counts a cell whose formula returns an empty string, because that cell is not truly empty. The one thing it leaves out is a genuinely empty cell. Its syntax is COUNTA(value1, [value2], ...) and it takes up to 255 arguments.
What does COUNTBLANK count in Excel?
COUNTBLANK counts the empty cells in a range. It also counts a cell whose formula returns an empty string, treating it as blank, even though that cell is not truly empty. A cell holding 0 is not counted, because 0 is a value. Its syntax is COUNTBLANK(range), which takes a single range.
Does a formula that returns an empty string count as blank in Excel?
It depends on which function you ask. COUNTA reads a formula that returns an empty string as a filled cell and counts it, while COUNTBLANK reads the same cell as blank and counts it too. So that one cell lands in both totals, which is why COUNTA and COUNTBLANK can add up to more than the number of cells in the range.
Why does COUNT return a lower number than the rows I can see?
COUNT counts numbers only, and a number stored as text inside a range is not a number to it, so those entries drop out with no error. A column that looks entirely numeric but holds a few text-stored figures comes back short. Dates, on the other hand, do count, because Excel stores a date as a number underneath.
How do I count cells that meet a condition in Excel?
COUNT, COUNTA, and COUNTBLANK count everything in the range with no test applied. To count only the cells that match a condition, use COUNTIF for a single rule or COUNTIFS for several. Those add a criteria test that the three plain counting functions do not have.

Catch the errors before they ship

Reviewing a change to a model? Compare the two versions in your browser and see every changed cell, formula, and value. It's free, and nothing leaves your computer.