← All how-to recipes

How to count non-blank (non-empty) cells

✓ Verified in LibreOffice 25.8.7.3

Count how many cells in a range actually contain something, ignoring the empty ones.

The formula

AppFormulaNotes
Excel=COUNTA(A2:A6)COUNTA counts anything non-empty. COUNT counts only numbers; COUNTBLANK counts the empties.
Google Sheets=COUNTA(A2:A6)Identical.
LibreOffice Calc=COUNTA(A2:A6)Identical.

How it works

COUNTA counts every cell that is not empty, whether it holds text or numbers. With values only in A2, A4 and A6 (A3 and A5 blank), it returns 3. Use COUNT for numbers only, or COUNTBLANK for the empty ones.

Verified, not just documented

We ran =COUNTA(A2:A6) in LibreOffice 25.8.7.3 (headless, with forced recalculation) and it returned 3 — exactly the expected result. Every formula here is confirmed by actually executing it.