Knowledge base / Excel
COUNT in Excel: numeric values, text and visible rows
I explain why a value that looks numeric can disappear from a count and why SUBTOTAL code 103 does not preserve COUNT semantics.

COUNT counts numeric values. I use it for an initial inspection of columns such as amounts, but first establish what the question concerns: numbers, occupied cells, documents or values meeting a criterion. A result on the screen does not establish that I chose the correct count. Values that resemble numbers while being stored as text are particularly easy to miss when inspecting only the appearance of a column.
Basic syntax
Microsoft documents COUNT as counting cells containing numbers and numeric values in its argument list:
=COUNT(value1, [value2], ...)
Square brackets indicate an optional argument in a syntax description. For a range, I simply write =COUNT(A2:A9). English examples here use commas between arguments, while Polish examples use semicolons; adapt the separator to regional settings. A range can contain multiple value types without every cell contributing to the count. It also matters whether a value comes through a reference or is entered directly into the formula.
A small example of stored types
This dataset is synthetic. The descriptions identify actual cell contents. You can enter text 20 as '20 with an apostrophe to prevent numeric conversion. A7 must contain an actual Excel date stored numerically. A9 contains an error value rather than the error’s name typed as text. These distinctions define the example; similar visual formatting alone is not enough to establish them.
| Cell | Contents | Counted by COUNT(A2:A9)? |
|---|---|---|
| A2 | numeric 10 | yes |
| A3 | numeric 0 | yes |
| A4 | text 20 | no |
| A5 | logical TRUE | no |
| A6 | genuinely empty cell | no |
| A7 | date 2026-10-31 stored numerically | yes |
| A8 | formula ="" |
no |
| A9 | error #DIV/0! |
no |
=COUNT(A2:A9)
The result is 3: 10, zero and the date. COUNT does not add amounts, so the result is neither 10 nor the date’s numeric value. It does not count distinct values either. If two cells contain the same number, both contribute. That is a property to match to your question, rather than a problem to remove by changing how the number is displayed in the result cell.
Why zero and dates contribute
Zero is a numeric value. In a measurement column, zero may represent a real observation while an empty cell means no observation. I do not substitute one for the other without an explicit rule. If zero represents missing data in your source, that convention needs explanation. COUNT cannot infer it from a column heading, and treating it as missing changes the meaning of the count.
Dates stored numerically are also counted, as the COUNT documentation explains. Therefore, a result of 3 does not prove that the column contains three valid amounts. One numeric cell might be a date in the wrong field. I use the count as a prompt to inspect input types, rather than as a complete quality certificate for the entire column.
Numeric text and ISNUMBER
The Polish equivalent of ISNUMBER is CZY.LICZBA. The documented IS functions test values without converting numeric text into numbers:
=ISNUMBER(A4)
For text 20 in our example, the result is FALSE; for numeric zero in A3, it is TRUE. A helper column copied down can reveal rows that need inspection. The old Polish name JEST.LICZBA was incorrect. A FALSE result still needs interpretation: the field might contain intentional text, a missing value or an import problem. It does not automatically identify a record that should be deleted or replaced.
If the field should hold amounts, plan conversion after checking the source. Microsoft describes Convert to Number for recognized numbers stored as text. Converting A4 would raise the count to 4. I do not mechanically convert identifiers, however, because leading zeros can be part of a code. Establish the meaning of the field before deciding that its stored type is wrong.

Direct arguments can behave differently
I avoid shortening the rule to “COUNT always ignores text and logical values.” Microsoft distinguishes values in references from values supplied directly. Logical values and numeric text typed directly into the argument list are counted:
=COUNT(TRUE,"20")
The result is 2. The same types stored in A4 and A5, passed as =COUNT(A4:A5), produce 0. These are different ways to supply arguments. When explaining an unexpected count, I show the complete formula rather than only the displayed values. Moving a constant from the formula into a cell can change how that particular count behaves, even when the visible content appears equivalent.
Occupied cells and errors
For the same dataset, COUNTA returns 7. It excludes genuinely empty A6 but includes TRUE, text, the error and the formula returning empty text. Choosing COUNT or COUNTA changes the question. Neither function independently determines how many documents are correctly reconciled or how many usable survey responses were collected. Those concepts need rules beyond a cell’s basic stored type.
COUNT ignoring an error in a reference does not repair the error. If an amount column should contain eight numeric values, a count of 3 calls for investigating the other five cells. I do not replace missing values with zero simply to align the count with an expectation. I first establish what those entries mean. For counting based on a condition, continue with COUNTIF.
Count visible numeric cells after filtering
Ordinary COUNT does not limit its result to visible rows. For a vertical range B2:B10, use this to exclude both filtered-out and manually hidden rows:
=SUBTOTAL(102,B2:B10)
The SUBTOTAL documentation assigns 102 to COUNT and 103 to COUNTA. Code 2 also counts numbers and excludes filtered-out rows, but includes manually hidden rows. Replacing 102 with 103 changes the counted value types. Check the range orientation too: hiding a column in a horizontal layout does not behave like hiding a row in a vertical list. Choose the function code and layout for the question you actually need answered.
Practice: choose a meaningful count
Explain where 3 and 7 come from in the example. Then decide whether your question concerns numbers or occupied fields. Add two identical numeric values and reason through why both increase COUNT. Finally, state what should happen when a row is hidden. Those decisions help select the operation before you copy a finished formula into a report, where a plausible total can otherwise conceal a mismatch between the calculation and its label.
Key takeaways
Does COUNT include zero and dates?
Yes. Zero is numeric, and a date stored by Excel as a numeric value is counted too. Text resembling a date can remain text.
How do I check whether a cell contains a number?
Use ISNUMBER. Its Polish equivalent is CZY.LICZBA; JEST.LICZBA in the old Polish entry was an incorrect function name.
How do I count numbers only in visible rows?
For a vertical range, use SUBTOTAL with code 102. Code 103 counts nonempty cells, including other value types.
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.
