← All how-to recipes

How to count blank cells in a range

✓ Verified in LibreOffice 25.8.7.3 ✓ Verified in Google Sheets (2026-08-30)

Count how many cells in a range are empty — useful for spotting missing data.

The formula

AppFormulaNotes
Excel (desktop)=COUNTBLANK(A2:A7)
Google Sheets=COUNTBLANK(A2:A7)Identical.
LibreOffice Calc=COUNTBLANK(A2:A7)Identical.

How it works

COUNTBLANK counts truly empty cells in the range. In the sample, A3, A5 and A7 have nothing in them, so the result is 3. Note that a cell containing a formula that returns "" counts as blank in all three apps, while a space character does not — a common gotcha when data is pasted from elsewhere.

Verified, not just documented

We ran =COUNTBLANK(A2:A7) in LibreOffice 25.8.7.3 (headless, with forced recalculation) and it returned 3 — exactly the expected result. We then ran the same formulas in Google Sheets, executed 2026-08-30: a formula-only workbook goes into Google Drive, which converts it to a Sheet and recalculates every formula with Google’s own engine, and comes back out as .xlsx carrying the values Google computed. It returned 3 for the worked example, the same value LibreOffice produced. Both engines’ numbers on this page are executed results. The Excel formula follows Microsoft’s official documented syntax — we do not run desktop Excel.

Functions used

COUNTBLANK — see full Excel, Google Sheets & LibreOffice compatibility for each.

Related comparisons