Knowledge base / Excel
COUNTA in Excel: what actually gets counted
Seven synthetic cells show why a nonblank count does not establish record completeness or the number of unique people.

When I need to count cells containing some information, I use COUNTA. I still pay attention to what the result means. A cell can look empty and be counted. The number of populated cells is not necessarily the number of customers, valid answers or complete records. The function examines the range’s contents; I need to establish the business definition separately before using that count in a report.
Syntax and versions
With English function names and a comma argument separator:
=COUNTA(A2:A8)
The general syntax is COUNTA(value1, [value2], ...). Further values or ranges can be supplied, up to 255 arguments in total. Microsoft documents the function for versions including Microsoft 365, Excel 2024, 2021, 2019 and 2016. Its Polish name is ILE.NIEPUSTYCH. Argument separators depend on regional settings; the Polish examples use semicolons. Changing a separator does not change the counting question.
Seven cells, six counted values
The table describes synthetic contents of A2:A8. The phrases one space and empty cell are preparation instructions, not labels to enter as text. Enter formulas as formulas, without a leading apostrophe before the equals sign.
| Cell | Contents | Counted by COUNTA? |
|---|---|---|
| A2 | text A-01 |
yes |
| A3 | number 0 |
yes |
| A4 | logical value TRUE |
yes |
| A5 | formula ="" |
yes |
| A6 | one ordinary space | yes |
| A7 | genuinely empty cell | no |
| A8 | formula =1/0, producing #DIV/0! |
yes |
=COUNTA(A2:A8) returns 6. Of the seven positions, only A7 is genuinely empty. Microsoft’s documentation explicitly includes errors and empty text among the information counted. The error in A8 therefore does not mean the count itself becomes that error. This distinction matters when using the number as an import-quality check: an occupied cell may still contain an unusable value.
Empty text and missing content are different
A5 looks blank because its result is an empty string. It still contains a formula and is counted by COUNTA. A6 may also look inconspicuous, but it contains a space character. When a count seems surprising, I examine the formula bar. The appearance of the table alone is insufficient to establish what has actually been stored. A visually empty area and an empty cell are different observations.
COUNTBLANK also treats empty text as blank. For this table:
=COUNTBLANK(A2:A8)
The result is 2, covering A5 and A7. Adding the COUNTA and COUNTBLANK results gives eight even though the range contains seven cells. I therefore do not use the functions as an automatically disjoint partition. A5 belongs to both counts under their respective rules. There is no additional hidden cell to find; the two functions ask questions whose categories overlap for empty text.

When I need numbers or a condition
For a reference to the same range, COUNT includes only the number in A3:
=COUNT(A2:A8)
The result is 1. Text, the logical value, empty text and the error stored in those cells are not numbers here. This explanation concerns a range reference; Microsoft’s documentation distinguishes it from values supplied directly as arguments. I do not generalise the rule from this table to every possible call format. The distinction is especially relevant when comparing examples that look similar but pass their inputs differently.
If the question is how many tickets have a closed status, I use COUNTIF. For several criteria, I move to COUNTIFS. Merely containing some information does not satisfy that question. Selecting a counting function starts with the definition of the thing I want to count, rather than with whichever formula is shortest.
The range and filter are separate decisions
A1:Z100 means the specified rectangle, not the whole worksheet. A:A means the entire column, so I do not describe it as a dynamic range. In a simple report, I prefer an explicit data area excluding the header. Counting a header or a note below the table would make the result describe more than the records. I place the result outside its input range to avoid a circular reference.
Ordinary COUNTA is not a way to restrict counting to rows visible after filtering. For a vertical list, I use SUBTOTAL with function number 103:
=SUBTOTAL(103,A2:A8)
It excludes filtered-out and manually hidden rows. With no filtering or hidden rows, this example still returns six. It does not change the empty-text rule. I also do not extend the behaviour to hiding columns in a horizontal range; the function is designed for vertical lists. Visibility and the meaning of nonblank remain separate decisions even when one formula combines them.
Counting cells does not establish complete records
If a customer identifier appears in two rows, both populated cells are counted. The result is not automatically a unique-customer count. If a record has several fields, counting one column does not establish that the others are complete. Before using the result, I record what a row means and why I am checking for content. Those details determine whether the count is useful for the intended purpose.
In a quality report, I would distinguish missing content, a formula’s empty result and an error. Entering a space into a missing field increases the count without supplying the information the process needs. This small example shows why an increasing count can be misleading. A technical check needs an interpretation aligned with the table’s purpose before someone treats its result as evidence that the dataset is ready.
A small exercise without a complicated formula
Return to the seven cells. Clear A6, then replace the formula in A5 with a genuinely empty cell. After the first change, COUNTA should return five; after the second, four. Now describe which entries would be valid in an invented customer list. That will probably be a narrower criterion than containing anything at all. I want this distinction clear before building a larger report on top of the count.
Key takeaways
Does COUNTA include a formula returning empty text?
Yes. A formula returning an empty string is counted. A genuinely empty cell is not.
Are zero and errors counted?
Yes. In a range, COUNTA includes zero, logical values, text and error values. The count does not mean those entries are valid business data.
How do I count only visible nonblank cells in a column?
Use SUBTOTAL with function number 103 for a vertical range. It excludes filtered-out and manually hidden rows while retaining nonblank counting rules.
AI was used in an automated way while working on this article. If you want to learn how to do it too, check out this project.
