COUNT Function – Examples in Excel, VBA, Google Sheets

Written by

Editorial Team

Reviewed by

Steve Rynearson

Last updated on February 9, 2023

This Excel Tutorial demonstrates how to use the Excel COUNT Function in Excel to count numbers, with formula examples.

Formula Examples:

COUNT Function Description:

The COUNT Function Counts the number of cells that contain a number within a series.

How to use the COUNT Function in Excel:

To use the COUNT Excel Worksheet Function, type the following into a cell:


After entering it in the cell, notice how the COUNT formula inputs appear below the cell:
count formula syntax
You will need to enter these inputs into the function. The function inputs are covered in more detail in the next section. However, if you ever need more help with the function, after typing “=COUNT(” into a cell, without leaving the cell, use the shortcut CTRL + A (A for Arguments) to open the “Insert Function Dialog Box” for detailed instructions:
how to use the count function in excel

Syntax and Arguments:

The Syntax for the COUNT Formula is:


Function Arguments ( Inputs ):


– An array of numbers, text, or blank values.

Additional Notes

The COUNT Function counts the cells containing only numbers. It does not count logical values, errors, or text (including numbers formatted as text).

The COUNTA Function counts cells with any information. In addition to numbers it counts: logical values, error values, and empty text (“”).

The COUNTBLANK Function counts cells that are blank. Specifically, it counts any cells not counted by COUNTA.

If these COUNT Functions don’t meet your needs you can use COUNTIF or COUNTIFS to define custom criteria. Examples:
Countif Greater than Zero ( =countif(a:a,”>0″)……. <>

COUNT Examples in VBA

You can also use the COUNT function in VBA. Type:


For the function arguments (array, etc.), you can either enter them directly into the function, or define variables to use instead.

Return to the List of all Functions in Excel

For more information about the COUNT Formula visit the
Microsoft Website.

AI Formula Generator

Try for Free

Excel Practice Worksheet

practice excel worksheet

Practice Excel functions and formulas with our 100% free practice worksheets!

  • Automatically Graded Exercises
  • Learn Excel, Inside Excel!

Free Download

Return to List of Excel Functions