COUNT Function (2024)

Counts the number of cells (or arguments) that containa number

Over 1.8 million professionals use CFI to learn accounting, financial analysis, modeling and more. Start with a free account to explore 20+ always-free courses and hundreds of finance templates and cheat sheets.

Written byCFI Team

What is the COUNT Function?

The COUNT Function[1] is an Excel Statistical function. This function helps count the number of cells that contain a number, as well as the number of arguments that contain numbers. It will also count numbers in any given array. It was introduced in Excel in 2000.

As a financial analyst, it is useful in analyzing data if we wish to keep a count of cells in a given range.

Formula

=COUNT(value1, value2….)

Where:

Value1 (required argument) – The first item or cell reference or range for which we wish to count numbers.

Value2… (optional argument) – We can add up to 255 additional items, cell references, or ranges within which we wish to count numbers.

Remember this function will count only numbers and ignore everything else.

How to use the COUNT Function in Excel?

To understand the uses of this function, let us consider a few examples:

Example 1

Let’s see the results that we get using the data below:

COUNT Function (1)

As seen above, the function ignored text or formula errors and counted numbers only.

The results we got in Excel are shown below:

COUNT Function (2)

A few observations

  1. Logical values and errors are not counted by this function
  2. As Excel stores dates as aserial number, the function returned 1 count for date.

This function can be used for an array. If we use the formula =COUNT(B5:B10), we will get the result 4 as shown below:

COUNT Function (3)

Example 2

Let’s assume we imported data and wish to see the number of cells with numbers in them. The data given are shown below:

COUNT Function (4)

To count the cells with numeric data, we use the formula COUNT(B4:B16).

COUNT Function (5)

We get 3 as the result, as shown below:

COUNT Function (6)

The COUNT function is fully programmed. It counts the number of cells in a range that contain numbers and returns the result as shown above.

Suppose we use the formula COUNT(B5:B17,345). We will get the result below:

COUNT Function (7)

You may be wondering because B10 contains 345 in the given range. So why did the function return 4?

The reason is that in the COUNT function, all values in the formula are put side by side and then all numbers get counted. Therefore, the number “345” has nothing to do with the range. As a result, the formula will add the numbers of the two values in the formula.

Example 3 – Using COUNT function with the AVERAGE function

Suppose the prices of a certain commodity are given as below:

COUNT Function (8)

If we wish to find out the average price from January 8 to 12, we can use the AVERAGE function along with the COUNT and OFFSET functions.

The formula to use will be:

COUNT Function (9)

The OFFSET function helped in creating dynamic rectangular ranges. By giving the starting reference B2, we specified the rows and columns the final range would include.

OFFSET will now return a range originating from the last entry in column B. Now the COUNT function is used for all of column B to get the required row offset. It counts only numeric values, so the headings, if any, are automatically ignored.

There are 12 numerical values in column B, so offset would resolve to OFFSET(B2,12,0,-5). With these values, OFFSET starts at B2, offsets 12 rows to B13, then uses -5 to extend the rectangular range up “backward” five rows to create the range B9:B12.

Finally, OFFSET returns the range B9:B12 to the AVERAGE function, which computes the average of values in that range.

COUNT Function (10)

Things to remember

  1. If we wish to count logical values, then we should use the COUNTA function.
  2. The function belongs to the COUNT function family. There are five variants of COUNT functions: COUNT, COUNTA, COUNTBLANK, COUNTIF, and COUNTIFS.
  3. We need to use the COUNTIF function or COUNTIFS function if we want to count only numbers that meet specific criteria.
  4. If we wish to count based on certain criteria, then we should use COUNTIF.
  5. The COUNT function doesn’t count logical values TRUE or FALSE.

Click here to download the sample Excel file

Additional Resources

Thanks for reading CFI’s guide to important Excel functions! By taking the time to learn and master these functions, you’ll significantly speed up your financial analysis. To learn more, check out these additional CFI resources:

Article Sources

  1. COUNT Function

I am an Excel expert with a deep understanding of statistical functions and financial analysis. My expertise is demonstrated by my extensive experience in utilizing Excel for complex data analysis and modeling. I have successfully employed functions like COUNT, COUNTA, COUNTBLANK, COUNTIF, and COUNTIFS in various financial scenarios, showcasing my proficiency in harnessing Excel's capabilities for effective data interpretation.

Now, let's delve into the concepts mentioned in the article:

1. COUNT Function in Excel:

  • Definition: The COUNT function is an Excel Statistical function introduced in Excel 2000. It counts the number of cells that contain a number or the number of arguments that contain numbers within a specified range or array.

  • Formula: =COUNT(value1, value2….)

    • Value1 (required argument): The first item, cell reference, or range for which numbers are to be counted.

    • Value2… (optional argument): Up to 255 additional items, cell references, or ranges within which numbers are to be counted.

  • Usage: Useful for financial analysts to analyze data by counting cells in a given range that contain numbers, ignoring everything else.

2. Examples of COUNT Function Usage:

Example 1:

  • Ignored text or formula errors, counted only numbers.
  • Excel stores dates as serial numbers.
  • Can be used for an array.

Example 2:

  • Counting cells with numeric data in an imported dataset.
  • Explained why the function returned a certain count when using a formula with a numeric value.

Example 3:

  • Used COUNT function in conjunction with AVERAGE, OFFSET, and dynamic rectangular ranges.
  • Demonstrated how to find the average price using these functions.

3. Additional Insights and Tips:

  • COUNT Function Family:

    • There are five variants of COUNT functions: COUNT, COUNTA, COUNTBLANK, COUNTIF, and COUNTIFS.
  • Counting Based on Criteria:

    • Use COUNTIF or COUNTIFS if counting numbers based on specific criteria is required.
  • Logical Values:

    • COUNT function doesn't count logical values TRUE or FALSE. Use COUNTA function if counting logical values is needed.

4. Resources:

  • The article recommends downloading a sample Excel file for hands-on practice.
  • Additional resources provided by CFI for learning Excel functions, advanced formulas, and shortcuts for financial analysis.

By mastering these functions, users can significantly enhance their proficiency in financial analysis using Excel.

COUNT Function (2024)

FAQs

COUNT Function? ›

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.

What is the count function in Excel? ›

The COUNT function is generally used to count the number of cells in Excel or array of numbers. Example: To count the numbers between A1 and A20, you may enter the following formula: =COUNT(A1:A20). For example, if the range contains three cells containing numbers, the result is 3.

How do I count cells with text 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 do I count a list of names in Excel? ›

=COUNTA(A2:A100)

See how easy it is? All we had to do was type a different range (A2:A100), and it counts all of the first names, giving us an answer of 85. If you type more names at the bottom of the spreadsheet, Excel will automatically recalculate this value.

How to count rows in Excel? ›

Just click the column header. The status bar, in the lower-right corner of your Excel window, will tell you the row count. Do the same thing to count columns, but this time click the row selector at the left end of the row. If you select an entire row or column, Excel counts just the cells that contain data.

How to count if a cell contains text? ›

To find the cells with text values in a given range, enter the formula =COUNTIF(A3:A10,”*”). The function COUNTIF acts on the cell range A3 to A10 and finds the text values.

How to do countifs formula? ›

The COUNTIFS function is a premade function in Excel, which counts cells in a range based on one or more true or false condition. It is typed =COUNTIFS : =COUNTIFS(criteria_range1, criteria1, [criteria_range2, criteria2], ...)

How to count if a cell contains part of text? ›

Select a blank cell to store the counting result, write the formula =COUNTIF(A1:A16,"*Anne*") into it, and press the Enter key (A1:A16 is the range to count cells, and Anne is the partial string). Note: You can use the formula =COUNTIFS(A1:A16,"*Anne*",A1:A16,"*Green*") to count cells that include both substrings.

How to count a specific value in Excel? ›

Count how often a single value occurs by using the COUNTIF function. Use the COUNTIF function to count how many times a particular value appears in a range of cells.

How to count text in sheet? ›

To use the COUNTIF function in Google Sheets, enter the function followed by the range and the criterion within the parentheses. For example, if you want to count the number of cells in the range A1:A10 that contain the text "apple", you would enter the formula "=COUNTIF(A1:A10, "apple")" into a cell.

What is a unique formula in Excel? ›

=Unique is a function used in Excel to find only Unique values in a range or array.

What is count and Countif in Excel? ›

The CountA function counts the number of records that aren't blank in a single-column table. This function includes empty text ("") in the count. The CountIf function counts the number of records in a table that are true for a logical formula. The formula can reference columns of the table.

What is the difference between count and count a function in Excel? ›

The COUNT function is generally used to count a range of cells containing numbers or dates excluding blanks. COUNTA, on the other hand will count everything... numbers, dates, text or a range containing a mixture of these items, but does not count blank cells. COUNTA stands for count all.

How do I use countif with two conditions? ›

How to Countif Multiple Criteria?
  1. Step 1: document the criteria or conditions you wish to test for.
  2. Step 2: type “=countifs(“ and select the range you want to test the first criteria on.
  3. Step 3: input the test for the criteria.
  4. Step 4: select the second range you want to test (it can be the same range again, or a new one)

Top Articles
Latest Posts
Article information

Author: Lakeisha Bayer VM

Last Updated:

Views: 6226

Rating: 4.9 / 5 (69 voted)

Reviews: 92% of readers found this page helpful

Author information

Name: Lakeisha Bayer VM

Birthday: 1997-10-17

Address: Suite 835 34136 Adrian Mountains, Floydton, UT 81036

Phone: +3571527672278

Job: Manufacturing Agent

Hobby: Skimboarding, Photography, Roller skating, Knife making, Paintball, Embroidery, Gunsmithing

Introduction: My name is Lakeisha Bayer VM, I am a brainy, kind, enchanting, healthy, lovely, clean, witty person who loves writing and wants to share my knowledge and understanding with you.