Documents & OCRPractical guides

Four cells, five counts: where COUNTA and COUNTBLANK overlap

COUNTA returns 3 and COUNTBLANK returns 2 for four cells. Before changing the range, inspect a formula that looks empty: it can enter both counts. After explaining the overlap, a more practical question remains: are you counting cells containing something, or completed business records?

Overhead photograph of a graph-paper notebook and pen
Illustrative photo: Kelly Sikkema · Unsplash LicenseStock illustration for the topic, not a screenshot, test of the pictured equipment or product recommendation.

What changed: Added a four-record case distinguishing cell counts from a 25% row-completion rate under explicit business rules.

Key Takeaways

COUNTA counts formulas that return empty text (""), and COUNTBLANK counts those results as blank too. The functions are not complements. For a truly empty cell, a ="" formula, numeric zero and text x, Microsoft’s rules give COUNTA 3 and COUNTBLANK 2. If completion means cells excluded by COUNTBLANK, subtract it from ROWS times COLUMNS, then separately check errors, spaces and business validity.

In this article

Build a four-cell exercise first

In your own blank practice sheet, clear the contents of A1 so that it is truly empty. Enter the formula ="" in A2, numeric 0 in A3 and ordinary text x in A4. A2 must contain a formula, rather than two quote characters typed as text. Do not put a space in A1.

The values below are reference results derived from the documented rules and an exercise you can reproduce. No native Excel run was performed for this article. Check your actual Excel version, formula bar and referenced range if your result differs; appearance alone does not identify the content.

Rule-derived reference for four cells
CellActual contentCOUNTA includesCOUNTBLANK includes
A1Truly emptyNoYes
A2Formula =""YesYes
A3Number 0YesNo
A4Text xYesNo

Enter separately outside the sample range

=COUNTA(A1:A4)
=COUNTBLANK(A1:A4)
=ROWS(A1:A4)*COLUMNS(A1:A4)
Reference results: 3, 2 and 4. Removing the A2 formula would change the example rather than fix the metric.

These definitions overlap

The Microsoft COUNTA reference includes empty text and error values. The COUNTBLANK reference includes formulas returning empty text and excludes zero. A2 is counted twice across the two results, so 3 + 2 = 5 is consistent.

This does not mean Excel treated zero as blank or discovered a fifth cell. The functions answer different questions. When missing data and numeric zero matter, use the distinctions in missing versus zero in extracted tables; do not discard a valid zero simply because it resembles an unfilled response.

The cell count is right. Why can completion still be wrong?

For a single continuous rectangular range such as A1:A4, =ROWS(A1:A4)*COLUMNS(A1:A4)-COUNTBLANK(A1:A4) counts cells outside COUNTBLANK’s blank definition, giving a reference result of 2. It includes numeric zero and text x while excluding true blanks and formula empty text. It does not assess business validity.

Now use the four authored rows below. A completed row requires an identifier nonempty after trimming surrounding ASCII spaces and a numeric quantity of zero or above. Row 1’s zero is valid. Row 2 returns empty text, row 3 has a spaces-only identifier, and row 4 puts text in quantity. Exactly one row meets this explicit rule: 1/4=25%. This is a rule-based derivation, not a native Excel run performed for this revision.

Place the four exercise identifiers and quantities in A2:B5, enter the row test in C2, fill through C5, then count TRUE across the four rows. Numeric zero passes ISNUMBER; text numbers do not. IFERROR marks error inputs incomplete. This rule uses ASCII spaces: TRIM alone does not remove nonbreaking spaces. Reference results are TRUE, FALSE, FALSE, FALSE and 25%. No native Excel run was performed; reproduce in your version and adjust argument separators for its locale.

An area that looks populated can therefore produce a different row-level result. Validate required fields and allowed values within each row, then count qualifying rows, keeping numerator and denominator in the same unit: records. Adding cell counts across fields does not produce a completed-record count.

When a number differs from expectations, inspect the actual range, cell contents and row-validity conditions in that order. A wrong range, differing function definitions and invalid business entries are different causes. For later exports, use the formula-cache and multiple-sheet checks on the actual file.

Authored row rule: identifier nonempty after trimming; quantity a nonnegative numeric value.
RowIdentifierQuantityCompleted?
10001Numeric 0Yes
20002Formula empty textNo
3Spaces onlyNumeric 5No
40004Text xNo

Row helper and completion rate

=IFERROR(AND(LEN(TRIM(A2))>0,ISNUMBER(B2),B2>=0),FALSE)

=COUNTIF(C2:C5,TRUE)/ROWS(C2:C5)
Fill the first formula from C2 through C5. Calculate the second outside the range and format as a percentage. Retain original columns A and B.

Further reading & sources