Excel COUNTA Function

The COUNTA function is one of the counting functions in Excel that counts all non-empty cells in a range.

Whether you’re working with text, numbers, dates, or even error values, COUNTA will count them all as long as the cell isn’t completely empty.

When to Use Excel COUNTA Function

COUNTA function can be used when you want to count all the cells in a range that are not empty. This is particularly useful for:

  • Counting survey responses – regardless of whether they contain text, numbers, or dates
  • Data validation – ensuring all required fields have been filled
  • Progress tracking – monitoring how many items in a list have been completed
  • Attendance tracking – counting entries in attendance sheets
  • Quality control – verifying data entry completion

What COUNTA Function Returns

It returns a number that represents the number of cells that are not empty in the specified range(s).

Syntax

=COUNTA(value1, [value2], [value3], …)

where:

  • value1 – the first item, cell reference, or range within which you want to count the number of cells that are not empty.
  • [value2], … – (optional) up to 255 additional items, cell references, or ranges within which you want to count the number of cells that are not empty.

Example 1: Count Non Blank Cells in a Range

Let’s start with a simple example.

Below I have a dataset, and I want to count the total number of non-empty cells in the range A1:A10.

Data to use counta

Here is the formula that will do this.

=COUNTA(A1:A10)
COUNTA function to count non blank cells in a range

This counts all non-empty cells in the range A1:A10.

Pro Tip: If you want to count all the non-blank cells in the entire column, you can use =COUNTA(A.:.A)

Example 2: Count Non Blank Cells in Multiple Ranges

Below I have numbers in Column A and Column C, and I want to count all the non-blank cells in these two ranges.

Data in multiple ranges

I can use multiple ranges within a single COUNTA function, as shown below.

=COUNTA(A1:A10, C1:C10)
Formula to count non-empty cells in multiple ranges

This will count all the non-empty cells across all the multiple separate ranges specified in the formula.

Example 3: Count Non Blank Cells with Mixed Data Types

Below I have a dataset where I have different types of data types in the cells, including text, error, number, date, and Boolean value.

Dataset with mixed data type

Here is the formula that will count all the non empty cells:

=COUNTA(A1:A7)
COUNTA function to count cells with mixed data

Example 4 – Number all the Filled Cells / Rows

Below I have a dataset where I have some data in column B, and I want to add a serial number in the cells in column A only if the cell in column B is filled. If the cell in column B is empty, I do not want to put any number on it.

Dataset to number rows in Excel

Here is the formula that will do this.

=IF(ISBLANK(B2), "",COUNTA($B$2:B2))
CountA formula to number filled rows in Excel

The above formula first checks whether cell B2 is empty or not using the ISBLANK function. If the cell is empty, it returns a null string. But if it is not empty, it uses the COUNTA function to count all the filled cells starting from cell B2.

This gives us a sequential serial number for all the filled cells while skipping the blank cells.

Example 5: Survey Response Tracking

You can also combine the result of the COUNTA function with a text string to get insights about your data.

For example, below I have a dataset where I have survey responses, and I want to know how many survey responses I have received.

survey response data

Below is a formula that could give the result of the counter function and then append the string to give me insights about the data.

=COUNTA(B2:B50) & " responses received"
COUNTA function to get survey responses

Additional Notes

  • Counts all non-empty cells – If a cell contains any type of information including error values, it is counted by COUNTA
  • Empty string handling – If a formula returns an empty string (“”), that cell is still counted by COUNTA
  • Performance tip – For large datasets, specify exact ranges instead of entire columns (use A1:A1000 instead of A:A). Or use the TRIMREF function or the dot operator to ensure that blank cells around the ranges are ignored
  • Hidden data – COUNTA counts cells that appear empty but contain spaces or non-visible characters

Related Excel Functions:

Other Excel articles you may also like:

Picture of Sumit Bansal
Hey! I'm Sumit Bansal, founder of TrumpExcel.com and a Microsoft Excel MVP. I started this site in 2013 because I genuinely love Microsoft Excel (yes, really!) and wanted to share that passion through easy Excel tutorials, tips, and Excel training videos. My goal is straightforward: help you master Excel skills so you can work smarter, boost productivity, and maybe even enjoy spreadsheets along the way!

FREE EXCEL E-BOOK

Get 51 Excel Tips Ebook to skyrocket your productivity and get work done faster

FREE EXCEL E-BOOK

Get 51 Excel Tips Ebook to skyrocket your productivity and get work done faster

Free-Excel-Tips-EBook-Sumit-Bansal-1.png

FREE EXCEL E-BOOK

Get 51 Excel Tips Ebook to skyrocket your productivity and get work done faster

Free-Excel-Tips-EBook-Sumit-Bansal-1.png

FREE EXCEL E-BOOK

Get 51 Excel Tips Ebook to skyrocket your productivity and get work done faster

Free Excel Tips EBook Sumit Bansal

FREE EXCEL E-BOOK

Get 51 Excel Tips Ebook to skyrocket your productivity and get work done faster