Excel for Microsoft 365 Excel for Microsoft 365 for Mac Excel for the web Excel 2021 Excel 2021 for Mac Excel 2019 Excel 2019 for Mac Excel 2016 Excel 2016 for Mac Excel 2013 Excel 2010 Excel 2007 Excel for Mac 2011 Excel Starter 2010 More...Less
The COUNT function counts the number of cells that contain numbers, and counts numbers within the list of arguments. Use the COUNT function to get the number of entries in a number field that is in a range or array of numbers. For example, you can enter the following formula to count the numbers in the range A1:A20: =COUNT(A1:A20). In this example, if five of the cells in the range contain numbers, the result is 5.
Syntax
COUNT(value1, [value2], ...)
The COUNT function syntax has the following arguments:
-
value1Required. The first item, cell reference, or range within which you want to count numbers.
-
value2, ...Optional. Up to 255 additional items, cell references, or ranges within which you want to count numbers.
Note:The arguments can contain or refer to a variety of different types of data, but only numbers are counted.
Remarks
-
Arguments that are numbers, dates, or a text representation of numbers (for example, a number enclosed in quotation marks, such as "1") are counted.
-
Logical values and text representations of numbers that you type directly into the list of arguments are counted.
-
Arguments that are error values or text that cannot be translated into numbers are not counted.
-
If an argument is an array or reference, only numbers in that array or reference are counted. Empty cells, logical values, text, or error values in the array or reference are not counted.
-
If you want to count logical values, text, or error values, use the COUNTA function.
-
If you want to count only numbers that meet certain criteria, use the COUNTIF function or the COUNTIFS function.
Example
Copy the example data in the following table, and paste it in cell A1 of a new Excel worksheet. For formulas to show results, select them, press F2, and then press Enter. If you need to, you can adjust the column widths to see all the data.
Data | ||
12/8/08 | ||
19 | ||
22.24 | ||
TRUE | ||
#DIV/0! | ||
Formula | Description | Result |
=COUNT(A2:A7) | Counts the number of cells that contain numbers in cells A2 through A7. | 3 |
=COUNT(A5:A7) | Counts the number of cells that contain numbers in cells A5 through A7. | 2 |
=COUNT(A2:A7,2) | Counts the number of cells that contain numbers in cells A2 through A7, and the value 2 | 4 |
COUNTIF function (counts the number of cells that meet a criterion)
COUNTA function (counts the number of cells that are not empty in a range)
Need more help?
Want more options?
Discover Community
Explore subscription benefits, browse training courses, learn how to secure your device, and more.
Communities help you ask and answer questions, give feedback, and hear from experts with rich knowledge.
The COUNT function in Excel is a fundamental tool for tallying the number of cells containing numerical data within a specified range. It’s a cornerstone of data analysis, used extensively in various Excel versions like 365, 2021, 2019, and earlier versions.
This function employs a simple syntax: COUNT(value1, [value2], ...)
, where value1
is mandatory, denoting the first item, cell reference, or range to count numbers. The subsequent value2
, up to 255 additional items, are optional and allow for counting across multiple ranges.
The COUNT function is versatile in handling diverse data types but focuses solely on counting numerical values. It counts numbers, dates, or text representations of numbers (e.g., "1" within quotation marks) while disregarding logical values, text not convertible into numbers, or error values.
An illustration: consider a scenario where you have a range from A1 to A20 and wish to count the numbers within that range. You'd use the formula =COUNT(A1:A20)
. If, for instance, five cells within this range contain numbers, the result would be 5.
To extend the functionality, if you seek to count only specific numbers meeting certain criteria or if you want to count non-empty cells regardless of content (logical values, text, etc.), Excel offers the COUNTIF and COUNTA functions, respectively.
The COUNTIF function focuses on counting cells based on a given criterion, while COUNTA tallies non-empty cells within a range, providing a wider array of counting possibilities based on specific conditions or non-numerical data.
Overall, Excel's COUNT function serves as a foundational tool for quantitative analysis within spreadsheets, offering simplicity and efficiency in counting numerical data while allowing for more complex counting methodologies with its supplementary functions.
For deeper exploration, there are diverse resources available within the Microsoft 365 ecosystem, including training courses, community forums like the Microsoft Tech Community and Microsoft 365 Insiders, and support avenues like the Microsoft Community and Windows Insiders, providing rich insights and assistance for Excel users of all levels.