The COUNT function returns the number of values in a dataset.
This function is used to count numeric data in specified ranges and ignores text values, logical values, and empty cells.
Syntax
COUNT(value1, [value2, ...])
Argument |
Description |
Permitted values |
|---|---|---|
value1 |
First value or range taken into account in the calculation |
Numbers, ranges of cells with numbers |
[value2, ...] |
(optional) Additional values or ranges |
Numbers, ranges of cells with numbers |
Examples of use
Counting numbers in a range
If you have data in the range A1:A10 and want to know how many cells contain numbers:
=COUNT(A1:A10)
The formula counts the number of cells with numeric values in the range A1:A10.
Counting numbers from multiple ranges
If you want to count numbers in multiple ranges, for example, in A1:A10 and B1:B10:
=COUNT(A1:A10, B1:B10)
The formula counts the number of cells with numerical values in both ranges.
Mixed data
If range A1:A5 contains both text and numerical values, the COUNT function will only count the numerical values.
For example, if cells A1, A2, and A3 contain numbers, and cells A4 and A5 contain text:
=COUNT(A1:A5)
Result: 3.
Notes
–The COUNT function ignores empty cells and cells with text values.
–If you need to count cells that contain not only numbers but also text, use the COUNTA function.