The COUNT function
COUNT counts the cells that hold numbers. Text, blanks and TRUE/FALSE in a range are left out. Dates count, because a spreadsheet stores them as numbers.
That makes it a quick check on how complete a column is, and a useful clue when a number has secretly been stored as text.
=COUNT(value1, [value2], ...)
Arguments
- value1
- The first range or cell to count numbers in.
- value2, ...optional
- More ranges or cells to include.
Try it
=COUNT(B2:B7) in D2. Only Ellie, Mo and Kai have real numbers. "absent" is text, Ruth's cell is blank, and Leah's 58 was entered as text, so COUNT gives 3.
D2
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Pupil | Score | Scores entered | ||
| 2 | Ellie | 72 | 3 | ||
| 3 | Josh | absent | |||
| 4 | Mo | 64 | |||
| 5 | Ruth | ||||
| 6 | Kai | 81 | |||
| 7 | Leah | 58 | |||
| 8 | |||||
| 9 |
Edit the formula in D2, or change the data, and press Enter.
More examples
| Formula | Result | What it does |
|---|---|---|
| =COUNTA(B2:B7) | 5 | COUNTA counts anything that isn't empty, including the text. |
| =COUNTBLANK(B2:B7) | 1 | Just Ruth's cell is empty. |
| =COUNT(A2:A7) | 0 | Names are text, so there are no numbers to count. |
| =COUNTA(B2:B7)-COUNT(B2:B7) | 2 | A quick way to spot entries that aren't numbers. |
Tips
- Use COUNTA to count names or any non-empty cells, and COUNTBLANK for empty ones.
- To count only the numbers that meet a condition, such as scores over 60, use COUNTIF.
- If COUNT is lower than the number of values you can see, some of them are probably stored as text.
Common mistakes
- COUNT returns 0 on a column of names.COUNT only counts numbers. Use COUNTA for text.
- A score you can see isn't counted.It's stored as text, often from an import or a leading apostrophe. Convert the column to numbers.
Practise COUNT with instant feedback
Type real formulas into a working spreadsheet and get told straight away whether they work.