How to count cells that contain numbers in Excel
Formula (Excel and Google Sheets)
=COUNT(B2:B11)Use =COUNT(B2:B11). COUNT includes numbers and dates and skips text, blanks and errors.
- Result on the example
- 6 in
E1 - Works in
- Every current version
- Google Sheets
- Same formula
See it work
The formula is already in E1. Change any input and the result updates, or edit the formula to experiment.
How it works
COUNT looks at each cell and counts it only if it holds a number. Text answers like "n/a" and "thirty" and the empty cell are ignored, which leaves the six usable ages.
Dates are numbers underneath, so COUNT counts them too.
=COUNT(B2:B11)Result6
B2:B1110 rows × 1 col: 34, "Prefer not to say", 27, (empty), …A range: 10 cells in one column.
COUNT(B2:B11)6COUNT: Counts cells that contain numbers.- value1
B2:B1110 rows × 1 col: 34, "Prefer not to say", 27, (empty), …
- value1
In Google Sheets
The same formula works in Google Sheets: =COUNT(B2:B11). We ran it in Google Sheets mode on the same data and it returns 6.
Other ways to do it
Each one was run on the same example sheet.
| Formula | Result | When to use it |
|---|---|---|
| =SUMPRODUCT(--ISNUMBER(B2:B11)) | 6 | The same count with ISNUMBER, handy when you need to add another condition. |
| =COUNTA(B2:B11) | 9Different result | Counts every answer, text included. Counts the text answers too. |
Common mistakes
- Numbers stored as text (left-aligned, often with a green triangle) are not counted by COUNT. Convert them first, or count them too with
=SUMPRODUCT((B2:B11<>"")*ISNUMBER(--B2:B11)). - COUNT ignores TRUE and FALSE in a range, even though they act as 1 and 0 in arithmetic.
Try it yourself
Same data, empty answer cell. Your formula is graded instantly, then re-checked on changed data, so a typed-in number won't pass.
Count cells that contain numbers
E1, count how many respondents gave their age as a number in B2:B11.Questions
What is the difference between COUNT, COUNTA and COUNTBLANK?
COUNT counts numbers, COUNTA counts anything that isn't empty, and COUNTBLANK counts empty cells.
How do I count numbers above a value?
Use COUNTIF: =COUNTIF(B2:B11,">=40"). It also skips text.
Checked by running on 2026-10-30: every formula and result on this page was calculated by the Spreadsheet Practice formula engine, in both Excel and Google Sheets modes.