COUNT function - Microsoft Support (2024)

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.

COUNT function - Microsoft Support (1)

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?

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.

COUNT function - Microsoft Support (2024)

FAQs

How do I count the number of answers in Excel? ›

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).

How do I count the number of yes responses in Excel? ›

You can use the following formula to calculate the percentage of yes or no values in a range of cells in Excel: =COUNTIF (B5:AF5, "Yes")/COUNTA (B5:AF5) This formula will count the number of cells that contain the value "Yes" in the range B5:AF5, and then divide it by the number of cells that contain any value in the ...

How do I count word answers in Excel? ›

The formula to count words of a particular range is “=LEN(TRIM(cell))-LEN(SUBSTITUTE(cell,” “,””))+1.”

How do I count text responses in Excel? ›

In the empty cell, you can input the formula to count cells with text. The Excel formula for this function is "=COUNTIF (range, criteria)" without quotation marks. In this formula, the range is the cells you want to include in your count and the criteria is text.

How does Countifs work? ›

The COUNTIFS function applies criteria to cells across multiple ranges and counts the number of times all criteria are met.

How do you use Countifs formula? ›

The COUNTIFS function counts cells of a given range based on one or multiple conditions (criteria). It counts only those cells which meet all the stated conditions. The syntax of the function is given as follows: “=COUNTIFS(criteria_range1,criteria1,[criteria_range2,criteria2]…)

How do I count responses in a spreadsheet? ›

You can count cells that either contain data or are blank by using worksheet functions.
  1. Count nonblank cells in a range by using the COUNTA function. ...
  2. Count nonblank cells in a list with specific conditions by using the DCOUNTA function. ...
  3. Count blank cells in a contiguous range by using the COUNTBLANK function.

How do I count the number of responses in sheets? ›

The COUNT function is a premade function in Google Sheets, which counts cells with numbers. It is typed =COUNT and gets a list of cells: =COUNT(value1, [value2, ...])

How do I count fill cells in Excel? ›

On the Formulas tab, click More Functions, point to Statistical, and then click one of the following functions:
  1. COUNTA: To count cells that are not empty.
  2. COUNT: To count cells that contain numbers.
  3. COUNTBLANK: To count cells that are blank.
  4. COUNTIF: To count cells that meets a specified criteria.

Does Excel have a word count function? ›

Unfortunately, Excel doesn't provide any built-in tool for counting the number of words. Luckily, by combining serval functions you can make more complex formulas to accomplish almost any task.

What is the function to count words in a cell in Excel? ›

Use TRIM, LEN, SUBSTITUTE and SUMPRODUCT in Excel to count words.

How do you count if cells contain specific words? ›

The COUNTIF function counts cells based on the value of one or more criteria. The syntax is =COUNTIF(range, criteria). You can enter any number of criteria separated by commas in the formula. The value must be either exact or an approximate match.

What is the formula for if value yes in Excel? ›

So an IF statement can have two results. The first result is if your comparison is True, the second if your comparison is False. For example, =IF(C2=”Yes”,1,2) says IF(C2 = Yes, then return a 1, otherwise return a 2).

Top Articles
Latest Posts
Article information

Author: Nicola Considine CPA

Last Updated:

Views: 6383

Rating: 4.9 / 5 (49 voted)

Reviews: 80% of readers found this page helpful

Author information

Name: Nicola Considine CPA

Birthday: 1993-02-26

Address: 3809 Clinton Inlet, East Aleisha, UT 46318-2392

Phone: +2681424145499

Job: Government Technician

Hobby: Calligraphy, Lego building, Worldbuilding, Shooting, Bird watching, Shopping, Cooking

Introduction: My name is Nicola Considine CPA, I am a determined, witty, powerful, brainy, open, smiling, proud person who loves writing and wants to share my knowledge and understanding with you.