COUNTA function

COUNTA counts the number of non-empty cells in a range, regardless of their content type or whether they contain text, numbers, or errors.

=COUNTA(value1, ...)

Generate a COUNTA formula

Describe what you need. The generator will reach for COUNTA where COUNTA is the right tool, and tell you when it is not.

How to get a better answer
  • Name your columns by letter and by header: "column F (Net Value)" beats "the amount column".
  • State every condition, including the negatives — "not cancelled" changes the formula's shape.
  • Say where the data starts if it is not row 1, and whether it will grow.
  • Check the settings above match your spreadsheet: the wrong argument separator is a syntax error on your machine.

Arguments

How COUNTA reads its arguments
value1requiredCOUNTA
ArgumentRequiredDescription
value1RequiredA cell, range, or literal value to count. Empty cells contribute 0; any non-empty cell (including 0, false, or errors) contributes 1 to the count.
...RepeatingUp to 254 additional values, cells, or ranges to include in the count; arguments are counted in addition to value1 with the same rules.

Returns

A number representing how many cells in the given range(s) contain data (are non-empty).

Availability

Excel: All · Google Sheets: Supported

Worked examples

1. Count students enrolled in the class

StudentSubjectAssignmentScoreMax Score
AliceMathQuiz 185100
BobMathQuiz 192100
AliceMathQuiz 278100
BobMathQuiz 288100
CharlieEnglishEssay 195100
=COUNTA(A2:A6)

Result: 5

COUNTA counts the five non-empty cells in the Student column (A2:A6), one for each student name. It ignores the header row because that's outside the range.

2. Count total data entries across the gradebook

StudentSubjectAssignmentScoreMax Score
AliceMathQuiz 185100
BobMathQuiz 192100
AliceMathQuiz 278100
BobMathQuiz 288100
CharlieEnglishEssay 195100
=COUNTA(A1:E6)

Result: 30

The range A1:E6 contains 6 rows and 5 columns, all filled. COUNTA returns 30 because all 30 cells (including the header) contain data—no blanks in this range.

3. Count submitted scores when one student is missing a grade

StudentSubjectAssignmentScoreMax Score
AliceMathQuiz 185100
BobMathQuiz 192100
AliceMathQuiz 2null100
BobMathQuiz 288100
CharlieEnglishEssay 195100
=COUNTA(D2:D6)

Result: 4

COUNTA counts only non-empty cells. Since Alice's Quiz 2 score is blank, COUNTA returns 4—one less than the five students—showing that four scores have been entered.

Common errors

Which COUNTA error are you seeing?
COUNTA returned an error#NAME?
Use the correct spelling: =COUNTA(A2:A6).
#REF!
Verify the sheet and column still exist, or update the formula to reference a valid range like =COUNTA(A2:A6).
#CALC!
Exclude the formula's cell from the range, e.g., =COUNTA(A3:A5) if the formula is in A2, or move the formula to a different cell outside the counted range.
ErrorWhy it happensHow to fix it
#NAME?The function name is misspelled, e.g., =COUNT_A(A2:A6) or =COOUNT(A2:A6). Spreadsheets don't recognize the invalid name.Use the correct spelling: =COUNTA(A2:A6).
#REF!The range references a column or sheet that has been deleted, e.g., =COUNTA(Sheet2.A:A) after Sheet2 is removed, or a range pointing to a deleted column.Verify the sheet and column still exist, or update the formula to reference a valid range like =COUNTA(A2:A6).
#CALC!A circular reference occurs when COUNTA tries to count a range that includes the cell containing the formula itself, e.g., =COUNTA(A1:A5) entered in cell A2.Exclude the formula's cell from the range, e.g., =COUNTA(A3:A5) if the formula is in A2, or move the formula to a different cell outside the counted range.

Tips and when to use something else

  • COUNTA counts all non-empty cells, including text, numbers, dates, and even error values like #N/A. Use COUNT if you need to count only numeric values.
  • COUNTA treats cells with formulas as non-empty, even if the formula returns a blank string (""). To count cells that are truly empty, use COUNTBLANK instead.
  • You can pass multiple non-contiguous ranges: =COUNTA(A2:A6, C2:C6) counts non-empty cells in both the Student and Assignment columns.
  • When you need to count cells that meet a condition (e.g., scores above 80), use COUNTIF or COUNTIFS instead of COUNTA.

Frequently asked questions

Does COUNTA count cells that only have formatting, like a background color?
No. COUNTA only counts cells that contain actual data—text, numbers, dates, or formulas. Formatting alone does not make a cell non-empty.
What's the difference between COUNTA and COUNT?
COUNTA counts any non-empty cell regardless of content type (text, numbers, errors), while COUNT counts only cells containing numeric values. In a gradebook with student names and scores, COUNTA(A:A) includes all names, but COUNT(A:A) would return 0.
If a cell contains a formula that returns a blank string, does COUNTA count it?
Yes, COUNTA counts it as non-empty because the cell contains a formula, even though the result is blank. To count only cells with visible content, use a combination like =COUNTA(A2:A6)−COUNTIF(A2:A6,"").
Can I use COUNTA to count how many cells meet a specific condition?
No, COUNTA counts all non-empty cells regardless of their values. For conditional counting (e.g., scores greater than 80), use COUNTIF or COUNTIFS instead.

Need a different formula?

The full generator is not scoped to one function — describe any spreadsheet problem and it will pick.

Open the formula generator

Reviewed 2026-09-17