COUNTA in Google Sheets: Count Non-Empty Cells

How-to basics · Updated November 23, 2026

COUNTA in Google Sheets counts the number of cells in a range that contain any type of value, including numbers, text, dates, errors, and even formulas that return an empty string. It is the go-to function when you need to know how many cells are “filled in” in a column, row, or range. For example, =COUNTA(A2:A100) returns the count of non-empty cells in that range.

What Exactly Does COUNTA Count?

COUNTA stands for “count all” and it is designed to count every cell that is not truly empty. This includes:

  • Numbers – including dates and times, since they are stored as numbers.
  • Text – any string, even a single space.
  • Logical values – TRUE and FALSE.
  • Errors – like #N/A or #DIV/0!.
  • Formulas – even if they return an empty string like "".

It does not count cells that are completely blank – no formula, no space, no apostrophe. A cell with an apostrophe (‘) is considered non-empty because it contains a text character (the apostrophe is invisible but present).

COUNTA vs COUNT vs COUNTIF: Which One Do You Need?

Many people confuse these three functions, but they serve different purposes:

  • COUNT – counts only cells that contain numbers. Text, errors, and logical values are ignored.
  • COUNTA – counts all non-empty cells, regardless of type.
  • COUNTIF – counts cells that meet a specific condition, like =COUNTIF(A2:A100, "Yes").

For example, if A1 contains 5, A2 contains "Hello", and A3 is blank, then =COUNT(A1:A3) returns 1, while =COUNTA(A1:A3) returns 2. If you need to count only filled-in text entries, use =COUNTIF(A1:A100, "*?") – the *? wildcard matches any text with at least one character.

How to Use COUNTA in Google Sheets

Using COUNTA is straightforward. You can reference a range directly, or combine it with other functions for dynamic results.

  1. Basic usage: Type =COUNTA(A2:A100) in a cell. Replace the range with your actual data.
  2. Multiple ranges: You can add multiple ranges separated by commas, like =COUNTA(A2:A10, C2:C10). This counts non-empty cells in both ranges.
  3. Whole column: Use =COUNTA(A:A) to count all non-empty cells in column A. Be careful – this includes headers and any stray values far down the column.
  4. With FILTER: To count non-empty cells that meet a condition, combine with FILTER: =COUNTA(FILTER(A2:A100, B2:B100="Yes")).

COUNTA ignores empty cells automatically, so you don’t need to worry about blank rows in your data.

Common Problems and Misconceptions

Here are the most frequent issues users run into with COUNTA:

  • Counting formulas that return empty strings: If a formula like =IF(A1="", "", A1) is in a cell, COUNTA counts it as non-empty even if it displays nothing. To exclude these, use =COUNTIF(A2:A100, "?*") or =SUMPRODUCT((A2:A100<>"")*ISNUMBER(A2:A100)) if you only want numbers.
  • Accidentally counting spaces: A cell with a space (pressed spacebar) is counted. To avoid this, use =COUNTIF(A2:A100, "?*") which only counts text with at least one visible character.
  • COUNTA with errors: If your range contains errors, COUNTA still counts them. If you want to ignore errors, use =COUNTIF(A2:A100, "<>#N/A") or a more complex array formula.
  • Whole column counting: Using =COUNTA(A:A) counts every non-empty cell in the column, which might be thousands if you have stray data. Use a limited range like A2:A1000 instead.

COUNTA in Excel vs Google Sheets

COUNTA works almost identically in Microsoft Excel and Google Sheets, but there are minor differences:

  • Function name: Both use COUNTA.
  • Syntax: Both use the same syntax: =COUNTA(value1, [value2, ...]).
  • Array behavior: In Excel, if you pass an array constant like {1,2,"a"}, COUNTA counts all three. In Google Sheets, the same works.
  • Dynamic arrays: In Excel 365, COUNTA can spill over an array result if you use it with functions like FILTER. In Google Sheets, you might need to use ARRAYFORMULA explicitly for some array operations.

One notable difference: In Excel, COUNTA counts cells that contain formulas returning empty strings, just like Sheets. But in Excel, a cell with a formula that returns "" is counted, while a cell with a formula that returns #N/A is also counted. So behavior is consistent.

Practical Examples of COUNTA in Action

Let’s look at real scenarios where COUNTA is useful:

  • Tracking attendance: If column A has student names and column B has “Present” or blank, =COUNTA(B2:B30) gives the number of students present today.
  • Checking data entry completeness: Suppose you have a survey with 100 responses. Column C contains optional comments. =COUNTA(C2:C101) tells you how many respondents left a comment.
  • Counting items in a list: If column A has a list of products, but some cells are blank, =COUNTA(A2:A100) gives the total number of products listed.
  • Dynamic ranges with OFFSET: You can create a dynamic range that expands as you add data: =COUNTA(OFFSET(A1,0,0,COUNTA(A:A),1)) – but this can be circular if placed in the same column, so use a different column.

Frequently Asked Questions

Does COUNTA count cells with formulas that return blank?

Yes, COUNTA counts any cell that contains a formula, even if the formula returns an empty string "". This is a common gotcha. To exclude such cells, use =COUNTIF(A2:A100, "?*") which counts only text with at least one character, or =SUMPRODUCT((A2:A100<>"")*ISTEXT(A2:A100)) for text only.

How do I count only non-empty cells in a row?

Use =COUNTA(2:2) to count all non-empty cells in row 2. Replace the row number as needed. This works in both Google Sheets and Excel.

Can COUNTA count across multiple sheets?

Yes, but you need to reference each sheet separately. For example, =COUNTA(Sheet1!A2:A10, Sheet2!A2:A10) counts non-empty cells in both ranges. You cannot use a 3D reference like Sheet1:Sheet3!A2:A10 in Google Sheets – that syntax is only in Excel.

Why is my COUNTA returning a number higher than expected?

This usually happens because there are hidden characters, spaces, or formulas returning empty strings in your range. Check for cells that look blank but contain a space or an apostrophe. Use =COUNTIF(A2:A100, "?*") to count only visible text, or use =SUMPRODUCT(--(TRIM(A2:A100)<>"")) to ignore spaces.

Does COUNTA count cells with conditional formatting that hides them?

No, conditional formatting only changes the appearance of cells, not their content. COUNTA counts the underlying value regardless of formatting. If a cell is hidden via a filter, COUNTA still counts it because the cell is not deleted – it’s just hidden.

What is the difference between COUNTA and COUNTA in Google Sheets vs Excel?

Functionally, they are identical. The only difference is that Google Sheets might handle array formulas slightly differently, but for basic use, the syntax and results are the same.

Tips for Using COUNTA Effectively

  • Use with data validation: To ensure a column is fully filled, use =COUNTA(A2:A100)=ROWS(A2:A100) in a conditional formatting rule to highlight incomplete rows.
  • Combine with IF: To show a message when all cells are filled, use =IF(COUNTA(A2:A100)=ROWS(A2:A100), "Complete", "Missing " & ROWS(A2:A100)-COUNTA(A2:A100) & " entries").
  • Use with QUERY: In Google Sheets, you can use =QUERY(A2:B100, "select count(A) where B is not null") to count non-empty values in A where B is not null.
  • Remember the order: The arguments are separated by commas, not semicolons. In some European locales, you might need to use semicolons, but the standard is comma.

Alternatives to COUNTA

If COUNTA doesn’t fit your exact need, consider these alternatives:

  • COUNT: Count only numeric cells.
  • COUNTIF: Count cells that meet a specific condition (e.g., text, numbers above a threshold).
  • COUNTIFS: Count cells that meet multiple conditions across multiple ranges.
  • SUMPRODUCT: For complex criteria like counting non-empty cells with no spaces: =SUMPRODUCT(--(TRIM(A2:A100)<>"")).
  • DCOUNTA: A database function that counts non-empty cells in a field based on criteria. Useful for larger datasets.

COUNTA is one of the most versatile counting functions in Google Sheets. Once you understand what it counts and its limitations, you can use it to build dynamic dashboards, track data entry, and clean up your spreadsheets with confidence.

Related

Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.

More in How-to basics

Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources

Spotted an error in this guide? Let us know.