Conditional totals function
COUNTBLANK function in Google Sheets and Excel
COUNTBLANK counts the empty cells in a range, including cells whose formula returns empty text.
Checked against Microsoft's and Google's documentation on · Example calculated on a live sheet
- Excel 2016
- Excel 2019
- Excel 2021
- Excel 2024
- Microsoft 365
- Google Sheets
Syntax
COUNTBLANK(range)Arguments in [brackets] are optional. Google Sheets writes it COUNTBLANK(range).
Example
=COUNTBLANK(C2:C11) reads: Count how many cells in the age column C2:C11 are empty.
| A | B | C | D | E | F | G | |
|---|---|---|---|---|---|---|---|
| 1 | Name | Age | Plan | Joined | Missing ages | 1 | |
| 2 | mara@example.com | Mara | 34 | Pro | 12 Jan 2026 | ||
| 3 | jonas@example.org | Jonas | 41 | Basic | 15 Jan 2026 | ||
| 4 | MARA@example.com | Mara O. | 34 | Pro | 20 Jan 2026 | ||
| 5 | priya@example.net | Priya | Team | 2 Feb 2026 | |||
| 6 | tomas@example.com | Tomás | n/a | basic | 9 Feb 2026 | ||
| 7 | elif@example.org | Elif | 29 | Pro | 17 Feb 2026 | ||
| 8 | jonas@example.org | Jonas Lind | 41 | Basic | 23 Feb 2026 | ||
| 9 | kenji@example.net | Kenji | 52 | Enterprise | 3 Mar 2026 | ||
| 10 | sofia@example.com | Sofia | 23 | Team | 8 Mar 2026 | ||
| 11 | leo@example.org | Leo | 17 | Basic | 14 Mar 2026 |
G1 shows 1: Priya's age is missing.
How the spreadsheet calculates it
Counts the empty cells in C2:C11.
- 1. COUNTBLANK: Counts the empty cells in
C2:C11.range=`C2:C11`: the cells to check
More COUNTBLANK examples
=COUNTBLANK(A2:E11)Empty cells anywhere in the sign-up table.=COUNTBLANK(C2:C11)/ROWS(C2:C11)The share of members with no age (format as %).=IF(COUNTBLANK(A2:E2)>0,"Incomplete","Complete")A row check: does this sign-up have every field?=ROWS(C2:C11)-COUNTBLANK(C2:C11)How many ages are filled in.
Paste any of these into the formula explainer to see it step by step.
Tips
- Run it on every required column after an import to see where data is missing.
- Show missing values as a percentage so different-sized columns compare fairly.
- Remember that spaces and zeros aren't blank.
- Put the count next to the column header in a check row, so anyone opening the file sees at a glance how much data is missing.
What COUNTBLANK is used for
Data-quality checks on imports and forms (how many emails, ages or prices are missing), progress tracking on checklists, and alerts before a report is sent with gaps.
Arguments
| Argument | Required | What it is |
|---|---|---|
| range | Yes | The range to check, such as C2:C11. |
Common mistakes
Expecting a cell with a space in it to count as blank: it doesn't.
Expecting zeros to count: a cell holding 0 isn't blank.
Being surprised by formulas: a formula that returns "" looks empty and COUNTBLANK counts it, while
ISBLANKsays FALSE for the same cell.
In Google Sheets
Google Sheets has COUNTBLANK(range) with the same single argument. We haven't verified that it treats formulas returning "" exactly as Excel does, so test that case if your sheet relies on it.
Errors you may see with COUNTBLANK
- #REF!: Rows or columns the range pointed at were deleted, so the formula holds #REF! instead of a range.
Questions
How do I count empty cells in Excel?
COUNTBLANK(range). On this sheet COUNTBLANK(C2:C11) is 1: one member has no age.
How do I count cells that are not empty?
Use COUNTA for anything that isn't empty, or subtract: ROWS(C2:C11)-COUNTBLANK(C2:C11).
Does COUNTBLANK count cells with a space?
No. A space is a character, so the cell isn't blank. Find such cells with COUNTIF(range," ") or clean them with TRIM.
How do I show the share of missing values?
Divide by the number of rows: COUNTBLANK(C2:C11)/ROWS(C2:C11), formatted as a percentage.
What's the difference between COUNTBLANK and ISBLANK?
COUNTBLANK counts the empty cells of a whole range and gives one number. ISBLANK checks one cell and gives TRUE or FALSE, which suits an IF in a check column. They also disagree on formulas that return "": COUNTBLANK counts those cells as blank, ISBLANK doesn't.
Sources
Official documentation the facts on this page were checked against.