Function · Statistical
Excel COUNT function
The Excel COUNT function counts cells that hold numbers. The same six-cell log that COUNTA scores as 4 contains 2 numbers.
Syntax =COUNT(value1, [value2], ...)
=COUNT(B2:B7)Arguments
| Name | Required | What to pass |
|---|---|---|
| value1 | Required | The first number, cell, or range. |
| value2 | Optional | More values or ranges. In a range, only numbers and dates are counted. Text, blanks, TRUE, FALSE, and errors are skipped. |
Examples
Hours in a log that also holds names
=COUNT(B2:B7)Result 2
| A | B | |
|---|---|---|
| 1 | # | Entry |
| 2 | 1 | Maya |
| 3 | 2 | 8 |
| 4 | 3 | |
| 5 | 4 | Jordan |
| 6 | 5 | |
| 7 | 6 | 6 |
| 8 | Numbers | 2 |
COUNT counts numbers. On the hours log, Maya and Jordan are text, two cells are empty, and the only numbers are 8 and 6. COUNT returns 2. Dates count, because a date is a serial number. Text that looks like a number does not, when it sits in a cell.
The exception is an argument you type yourself. =COUNT(B2:B7,"1") counts the numbers in the range and also counts the quoted 1, because a number you type into the argument list is counted even as text. A range does not get that treatment. Use COUNT when the denominator of an average should be “how many numeric answers,” and COUNTA when a name is as good as a number.