The Excel COUNTA function is a statistics formula that returns the number of cells in a range that are not empty. Unlike the COUNT function, which only counts cells containing numbers, COUNTA includes cells with any type of information in them, containing numbers, text, logical values (TRUE or FALSE), and error values. Cells that are empty are not counted. In this guide, we’re going to show you how to use the Excel COUNTA function and also go over some tips and error handling methods.


Supported versions

COUNTA function is available across all versions of Excel.


Excel COUNTA Function Syntax

=COUNTA(value1, [value2], ...)

value1: This is the primary value or range that you want to count. It is a required parameter.
[value2], ...: These are optional additional arguments. You can include up to 255 arguments, allowing extensive flexibility in counting across multiple ranges or cells.

Examples of COUNTA Function

Use of COUNTA Function with Single argument

This example highlights how the COUNTA function in Excel operates. In this case, the formula is applied to a set of six cells, and it determines that five of these cells contain data. At a glance, it might seem confusing because only four cells visibly hold values like text or numbers.

=COUNTA(B3:C5)

The interesting aspect of the COUNTA function is its ability to recognize not just the cells that are clearly filled but also those that might look empty. For instance, consider cell C5 in this example. Although it appears empty, it actually contains an empty string, which is like a placeholder or a blank entry. When a cell contains a formula that returns an empty string, Excel does not consider the cell to be truly empty because the formula itself is a kind of content. Therefore, COUNTA will count this cell as non-empty. That's why the function reports five cells with content instead of four. This behavior is particularly important to keep in mind when you're using COUNTA for data analysis, as it could affect the count if your range includes cells with formulas that can result in empty strings.

Use of COUNTA Function with Multiple Arguments

This example shows how you can use the COUNTA function in Excel with several arguments at once. Here, the formula looks at three different groups of cells. It's a good way to see how COUNTA can work with many parts of a spreadsheet all at the same time.

=COUNTA(H3:H5,I5:K6,K8)

Excel lets you use lots of arguments with COUNTA – up to 255, actually. That means you can count cells in many different places in your spreadsheet, all with just one formula. This is really useful when you have a lot of data to work with.

Download Workbook

Understanding COUNTA vs. COUNT Function

The COUNTA function in Excel offers a broader scope of data recognition compared to the COUNT function. This distinction is particularly important in diverse datasets where data types vary widely. While the COUNT function is specialized and only tallies cells containing numerical values, COUNTA is designed to recognize and count cells with any form of data. This includes not only numbers but also text, logical values (such as TRUE or FALSE), and even cells that contain error values. This capability makes COUNTA an invaluable tool in situations where the presence of any data, regardless of its type, is what matters. For instance, in a dataset combining numerical values, text annotations, and logical flags, COUNTA can provide a total count of all cells that are not empty, offering a comprehensive overview of the dataset's filled entries.

Understanding the differences between COUNT and COUNTA is important for users dealing with complex data sets. COUNT is ideal for scenarios where the analysis is strictly number-oriented, like summing up sales figures or counting numerical entries in a ledger. However, for more complex scenarios where data comes in various forms — such as a survey spreadsheet containing a mix of numbers (like ratings), text (like comments), and perhaps logical values (like TRUE/FALSE responses) — COUNTA becomes essential. It ensures that every piece of information is accounted for, regardless of its format. This versatility of COUNTA is what makes it indispensable for a broad range of data analysis tasks in Excel, from simple data counting to managing and auditing extensive and varied datasets.

Use of COUNTA vs. COUNTBLANK Function

The COUNTA and COUNTBLANK functions in Excel are both used for counting cells, but they serve different purposes based on the type of data present in the cells. As explained in this article, COUNTA is designed to count non-empty cells in a specified range. On the other hand, COUNTBLANK is the opposite in function; it specifically counts the number of empty cells in a given range. A cell is considered empty by COUNTBLANK if it has no data or formulas — it’s truly blank. This function is particularly useful when you need to know how much of your data is missing or when you're assessing data completeness. For instance, in a dataset where every cell should contain information, COUNTBLANK can quickly tell you how many cells have been left unfilled. While COUNTA tallies the cells with content, COUNTBLANK focuses on the absence of content, making these two functions complementary for data analysis in Excel.

Use COUNTIF and COUNTIFS for Criteria-Based Counting

For more advanced scenarios, where you need to count cells that meet specific criteria, Excel offers COUNTIF and COUNTIFS functions. COUNTIF is ideal when you have a single condition for counting. For example, it's perfect for situations where you need to count cells containing a specific word like "Apple", or cells with values exceeding a certain number. This function simplifies tasks like tallying cells that match a certain text, meet a numerical condition, or equal the value in another cell.

For more complex scenarios requiring multiple conditions, COUNTIFS is the solution. This function allows you to count cells across different ranges based on various criteria. It's incredibly useful for filtering and counting data that must meet several conditions simultaneously, such as counting cells where one column says "Apple" and another shows dates beyond a specific day. While COUNTA just counts any cell that's not empty, COUNTIF and COUNTIFS are better when you need to be more specific about what you're counting. They're really useful for when you're dealing with a lot of data and need to count things in a more detailed way.


Error Handling in COUNTA Function

The COUNTA function in Excel is quite straightforward and robust, and it typically does not return error messages in the same way some other Excel functions might. This is because COUNTA's sole purpose is to count non-empty cells, and it does not evaluate the content of these cells. Therefore, the function itself is less prone to errors directly attributable to its own operation. However, there are a few scenarios where you might encounter issues related to the use of COUNTA, although they are not errors from the COUNTA function itself:

#REF! Error: If the range specified in the COUNTA function is invalid (for example, using an incorrect cell reference), Excel might display a #REF! error. This error, however, is due to an invalid reference in the formula, not an error in the COUNTA function itself.

Formula Errors in Counted Cells: While COUNTA will count cells with errors (like #DIV/0!, #VALUE!, etc.), these errors are not generated by COUNTA. They are the result of errors within the individual cells that COUNTA is counting. COUNTA will include these cells in its count as non-empty cells, but it does not evaluate or correct the errors.

Tips and Tricks

  • The COUNTA function counts empty text ("") values.
  • The COUNTA will also count cells that look empty, but actually contain invisible characters such as new line characters. These cells might appear empty but are technically not. This can sometimes lead to confusing results, as the COUNTA function will report more non-empty cells than visibly apparent. To handle this, you might need to clean your data by removing such invisible characters or using additional functions to identify and exclude them. If you are suspecting a cell may include this type of characters, you can find them using the Go To feature.
  • The COUNTA function counts error cells. COUNTA counts all non-empty cells, including those with errors or formulas that return errors. For example, if a cell contains a formula that results in #DIV/0!, COUNTA includes this cell in its count. Similarly, if a formula returns text, a number, a logical value, or an error, COUNTA treats the cell as non-empty.
  • If you want to count only cells that contain numbers, use COUNT.
  • If you want to count only cells that meet a certain criteria, use the COUNTIF or COUNTIFS functions.