COUNTA Function
The Excel COUNTA function counts cells that contain a value. It includes numbers, text, logical values, errors, and formulas returning empty text, while excluding only truly empty cells.
| Excel COUNTA Function | |||||||
| COUNTA measures non-empty cells, including formulas that display nothing. Change the cream values to test each case. | |||||||
| Source data, editable | COUNTA examples | ||||||
| Value Type | Mixed Value | Secondary Value | COUNTA sees value? | Example | Formula syntax | Result | |
| Standard number | 120 | 10 | Yes | Complete mixed range | =COUNTA(B12:B21) | 9 | |
| Text | Ready | Yes | Selected cells only | =COUNTA(B12,B13,B14,B19,B21) | 4 | ||
| True blank | Note | No | Two separate ranges | =COUNTA(B12:B16,C12:C16) | 8 | ||
| Zero | 0 | FALSE | Yes | True blank vs empty text | =COUNTA(B14,B21) | 1 | |
| Negative number | -8 | 0 | Yes | ||||
| True date | Jan 15, 2026 | Yes | Why an empty-looking cell can count | ||||
| Percentage | 25% | 50 | Yes | COUNTA includes numbers, text, logical values, dates, percentages, and numeric text. | |||
| Logical value | TRUE | Complete | Yes | B14 is truly empty, so it does not count. B21 contains a formula returning empty text, so it does. | |||
| Number stored as text | '42 | 75 | Yes | Use COUNT when only numeric values should contribute. | |||
| Formula returns empty text | 1 | Yes | |||||
| Reliability checks | |||||||
| Mixed-range count matches the nine explicitly non-empty cells | OK | ||||||
| Blank-vs-empty-text result equals the count of the formula cell alone | OK | ||||||
Overview
The Excel COUNTA function counts values rather than numbers. A cell contributes whenever it contains data or a formula—even when the displayed result looks blank.
Quick reference
Syntax: =COUNTA(value1, [value2], ...)
Returns: The number of non-empty values supplied. (integer)
Arguments:
value1(required) — The first value, cell reference, range, or array to test for non-empty content.value2(optional) — An additional value, cell reference, range, or array; more optional arguments may follow.
The bracketed arguments after value1 are optional. Add further values, references, ranges, or arrays when every non-empty entry should contribute to the same count.
Common uses
- Count populated fields in forms and checklists.
- Measure record or column completeness when any value qualifies.
- Count mixed text-and-number lists.
- Compare true blanks with formulas or invisible content during data-quality checks.
Calculations
COUNTA checks whether each supplied cell contains something. Numbers, text, dates, percentages, logical values, error values, and formulas all count. Only a cell with no value and no formula is excluded.
That distinction matters for formulas returning "". The worksheet may display nothing, but the cell still contains a formula and COUNTA includes it. Spaces and other invisible characters also count, which can make a completeness measure higher than the number of visibly populated cells.
Commas can combine individual cells or separate ranges. COUNTA returns zero when every supplied cell is truly empty.
Function behavior
Situation | Behavior |
|---|---|
True blank | Excluded when the cell has no value and no formula. |
Text | Counted, including numbers stored as text. |
Logical values | Counted in referenced cells. |
Errors | Counted as non-empty values. |
Formula returning | Counted because the formula occupies the cell. |
Spaces or invisible characters | Counted even when the cell appears empty. |
Common errors
Assuming visually blank means empty
What happens:
A formula returning empty text or a cell containing a space increases the result despite showing no visible content.
Better approach:
Inspect the formula bar and source data, then use a condition tailored to the substantive definition of empty when needed.
Using COUNTA for numeric observations
What happens:
Labels, statuses, errors, and other text increase the result and overstate the numeric sample size.
Better approach:
Use COUNT when only numeric values should contribute.
Treating non-empty as valid
What happens:
Placeholder text, errors, or stray spaces satisfy COUNTA even if the entry fails a business rule.
Better approach:
Use COUNTIF or COUNTIFS when validity depends on explicit criteria.
Example
Example 1 — Count a Mixed Range
=COUNTA(B12:B21)
Nine of the ten sample cells contain a value or formula. The one true blank is excluded, so the result is 9.
Example 2 — Count Selected Cells
=COUNTA(B12,B13,B14,B19,B21)
The number, text, logical value, and formula-generated empty text all count. The true blank does not, producing 4.
Example 3 — Count Multiple Ranges
=COUNTA(B12:B16,C12:C16)
This formula checks two separate five-cell ranges. Eight cells are non-empty across the combined blocks, so it returns 8.
Example workbook
The workbook contains COUNTA Example and Notes tabs. Ten mixed value types are classified with live formulas, and four examples cover a complete range, selected cells, multiple ranges, and the difference between a true blank and formula-generated empty text. Two checks reconcile the main results.
Key takeaway
COUNTA tests whether a cell contains something, not whether it looks populated or whether its content is valid.