Excel Supreme

Excel track · Exercise 17 of 86 Paid

COUNT: numbers only, and what it skips

Count the cells that hold real numbers, and read a short count as evidence of text.

Beginner

Readings with text and blanks

Read-only data · answer in B8

In B8, count how many readings in B2:B7 are really numbers.

AB
1SampleReading
2S-0112.5
3S-02n/a
4S-038.2
5S-04
6S-0515
7S-067
8Readings counted

Download this grid (.xlsx) Two tabs: the grid you see, and the answer.

B8

What it does

COUNT answers one thing about a range: how many of its cells hold a number. Text, blanks and logical values are passed over without complaint. This column returns 3, from the 12.5 in B2, the 8.2 in B4 and the 15 in B6.

The cells that do not count are the ones worth a look. B3 holds the text n/a, B5 is empty, and B7 holds a 7 that Excel keeps as text: it looks like a number and is not one. SUM over the same range returns 35.7, so the two readings of the column already disagree.

A count that comes back short is the quickest signal that some figures arrived as text. Set the column to left align and the numbers will shift, leaving the text where it was. COUNT never reports those cells; it just leaves them out.

Syntax

=COUNT(value1, [value2], ...)

Worked example

On Readings with text and blanks, =COUNT(B2:B7) returns 3.

=COUNT(B2:B7)

Common errors

Error codes for COUNT
ErrorWhat it means and how to fix it
One shortA reading stored as text is skipped, so the count lands below the figures you can see.
CircularA range that reaches B8 includes the cell holding the formula, so Excel reports a circular reference.
#REF!The range points at a row or a column that has since been deleted, leaving nothing to inspect.

At work

Importing a supplier's stock file, where some quantities arrive as text. The count tells you how many rows to fix before the file is usable.