What COUNTA does

COUNTA counts the non-blank cells in a range. Text, numbers, dates, TRUE or FALSE and even error values all count, and only truly empty cells are left out. On a sign-up sheet, =COUNTA(B2:B8) counts the names in B2 to B8.

That makes it the counter for lists of names, codes and replies, where COUNT would find nothing because the entries are text. Use it to see how many people signed up, or how many rows of data a list has.

Because it counts anything at all, COUNTA also counts entries you can’t see, such as a space typed into a cell. When a count looks one too high, that’s usually why.

Syntax

=COUNTA(value1, [value2], ...)
Arguments in square brackets are optional; the rest are required.
value1Required
The first cell or range to count in, such as B2:B8.
value2Optional, can repeat
More cells or ranges, separated by commas, up to 255 in all.

Example: how many places are taken

A workshop has seven places. Names go into column B as people sign up.

Five of the seven cells hold a name. In B9, =COUNTA(B2:B8) returns 5.

Example: how many haven’t replied yet

Seven people were invited and their replies go into column B. Subtract the replies from the number of rows to see who is still to answer.

7 rows minus 4 replies: Cleo, Femi and Gus haven't answered. In B9, =ROWS(B2:B8)-COUNTA(B2:B8) returns 3.

ROWS returns how many rows a range has, so the formula keeps working when the list grows, as long as the range grows with it.

Common mistakes

  • A space, or a formula that returns "", makes a cell count even though it looks blank. Clear those cells with Delete rather than typing a space over them.
  • =COUNTA(B1:B8) includes the heading in B1, so the count is one too high. Start the range on the first row of data.
  • COUNTA counts every reply, Yes and No alike. To count only the Yes replies, use =COUNTIF(B2:B8,"Yes").
  • When the column mixes numbers with notes and you want only the numbers, use COUNT.

Frequently asked questions

How do I count cells that are not blank?

=COUNTA(B2:B8) counts every cell in B2:B8 that holds something. It also counts cells that only look empty because they contain a space.

Why is COUNTA counting blank cells?

Those cells only look empty: a space, or a formula that returns empty text like =IF(A2="","",A2), still counts as an entry. Clear real gaps with Delete. For formula results, =ROWS(B2:B8)-COUNTBLANK(B2:B8) counts the filled cells, because COUNTBLANK treats empty text as blank.

Can COUNTA count with a condition?

No, it counts every entry. For one condition use COUNTIF, as in =COUNTIF(B2:B8,"Yes"), and for several use COUNTIFS.

How do I count non-blank cells after filtering?

Use =SUBTOTAL(103,B2:B50). It counts the cells that aren’t empty in the rows you can see and skips the rows a filter hides.

How do I count the empty cells instead?

Use COUNTBLANK: =COUNTBLANK(B2:B8) counts the empty cells in the range.