COUNTBLANK counts how many cells in a given range are empty. It returns a number, making it easy to spot missing data, gaps in lists, or incomplete records.
=COUNTBLANK(range)What does COUNTBLANK do?
COUNTBLANK is a simple statistical function that tells you how many cells in a range contain nothing at all. You point it at a range, and it returns a count of the blank cells. It does not count cells that contain a zero, a space, or an empty text string returned by a formula unless that formula truly returns an empty string.
Why does this matter? Missing data is one of the most common causes of broken reports, failed imports, and inaccurate summaries. COUNTBLANK gives you a quick health check on any table. Instead of scrolling and squinting, you get a number that tells you exactly how many gaps exist.
Imagine you receive a customer list every week and need to confirm every row has an email address. You can run COUNTBLANK on the email column and instantly see whether any are missing. If the result is zero, you are good to go. If not, you know exactly how many records need attention.
When to use COUNTBLANK
- Checking a contact list for missing email addresses or phone numbers.
- Auditing an expense sheet for rows without a category or receipt date.
- Confirming that a survey export has no unanswered questions.
- Validating imported data before running a pivot table.
- Tracking incomplete tasks in a project tracker.
- Spotting gaps in a date or ID column before sorting.
COUNTBLANK syntax
=COUNTBLANK(range)| Argument | Required? | What to enter |
|---|---|---|
range | Required | The cells you want to check for blanks. It can be a single column, a row, or a rectangular block such as B2:B10. Only the cells in this range are examined. |
What it returns: A whole number representing how many cells in the specified range are empty.
COUNTBLANK examples
1 Counting blanks in a single column
This example checks a short list of product codes. The goal is to see how many codes are missing. The formula =COUNTBLANK(B2:B6) looks only at cells B2 through B6 and counts those with nothing in them. B3 and B5 are empty, so the result is 2.
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Product | Code | |||
| 2 | Widget | W-100 | 2 | ||
| 3 | Gadget | ||||
| 4 | Doohickey | D-220 | |||
| 5 | Gizmo | ||||
| 6 | Thingamajig | T-330 | |||
| 7 |
2 Checking a whole table for missing values
Here we look at a small employee table with three columns. The goal is to count every empty cell across all data rows. The formula =COUNTBLANK(A2:C6) examines the entire block from A2 to C6. Empty cells are B3, C4, and B5, giving a total of 3.
| A | B | C | D | E | F | |
|---|---|---|---|---|---|---|
| 1 | Name | Department | Start Date | |||
| 2 | Alice | Sales | 2022-03-01 | 3 | ||
| 3 | Bob | 2021-07-15 | ||||
| 4 | Carol | Marketing | ||||
| 5 | David | 2023-01-10 | ||||
| 6 | Eve | Finance | 2020-11-20 | |||
| 7 |
3 Finding missing email addresses in a contact list
A common office task is checking that every contact has an email. The formula =COUNTBLANK(C2:C7) counts empty cells in the Email column. Only row 5 is missing an email, so the result is 1. You can then filter or highlight that row to follow up.
| A | B | C | D | E | F | |
|---|---|---|---|---|---|---|
| 1 | First Name | Last Name | ||||
| 2 | John | Smith | john.smith@example.com | 1 | ||
| 3 | Mary | Jones | mary.jones@example.com | |||
| 4 | Peter | Brown | peter.brown@example.com | |||
| 5 | Susan | Davis | ||||
| 6 | James | Wilson | james.wilson@example.com | |||
| 7 | Linda | Taylor | linda.taylor@example.com | |||
| 8 |
4 Auditing an expense report for missing categories
Expense reports often have rows without a category, which breaks summaries. The formula =COUNTBLANK(B2:B8) counts empty cells in the Category column. Rows 4 and 7 are blank, so the result is 2. This tells the reviewer exactly how many entries need a category before approval.
| A | B | C | D | E | F | |
|---|---|---|---|---|---|---|
| 1 | Date | Category | Amount | |||
| 2 | 2024-01-05 | Travel | 120.5 | 2 | ||
| 3 | 2024-01-06 | Meals | 45 | |||
| 4 | 2024-01-07 | 30 | ||||
| 5 | 2024-01-08 | Office Supplies | 89.99 | |||
| 6 | 2024-01-09 | Travel | 200 | |||
| 7 | 2024-01-10 | 15.75 | ||||
| 8 | 2024-01-11 | Meals | 60 | |||
| 9 |
5 Validating a survey export before analysis
Survey data often contains unanswered questions. The formula =COUNTBLANK(B2:D6) checks three question columns for blanks across all respondents. Empty cells are B3, C5, and D4, so the result is 3. Knowing this helps you decide whether to exclude incomplete responses or follow up.
| A | B | C | D | E | F | G | |
|---|---|---|---|---|---|---|---|
| 1 | Respondent | Q1 | Q2 | Q3 | |||
| 2 | R1 | Yes | No | Maybe | 3 | ||
| 3 | R2 | Yes | No | ||||
| 4 | R3 | No | No | ||||
| 5 | R4 | Yes | Yes | ||||
| 6 | R5 | Maybe | Yes | No | |||
| 7 |
Common COUNTBLANK errors and how to fix them
| Error | Why it happens | How to fix it |
|---|---|---|
| #NAME? | The range argument is not a valid reference, for example if you type text without quotes or use an incorrect range operator. | Make sure the argument is a proper range such as A1:A10 or a named range. Do not put text directly inside COUNTBLANK. |
| #NAME? | The function name is misspelled, such as COUNTBLANKS or COUNT_BLANK. | Use the exact spelling COUNTBLANK. Excel's formula autocomplete can help. |
| Wrong count (too low) | Cells that look empty actually contain a space, an apostrophe, or a formula returning an empty string. COUNTBLANK does not count those as blank. | Use =COUNTIF(range,"") to catch empty strings, or clean the data by removing spaces and stray characters. |
| Wrong count (too high) | The range includes cells outside the intended table, such as entire columns that contain formatting or notes far below the data. | Limit the range to the exact rows and columns of your table, for example B2:B100 instead of B:B. |
Tips for using COUNTBLANK
- Use COUNTBLANK together with COUNTA to get a quick completeness ratio:
=COUNTBLANK(A2:A100)/COUNTA(A2:A100). - If you need to count blanks based on a condition in another column, use
COUNTIFSwith a blank criteria instead. - Remember that COUNTBLANK treats cells with a formula that returns
""as not blank, so check for hidden formulas when results seem off. - Name your ranges (Formulas > Define Name) to make formulas like
=COUNTBLANK(EmailColumn)easier to read. - Combine COUNTBLANK with conditional formatting to highlight rows that have missing values.
Frequently asked questions
Does COUNTBLANK count cells with a space as blank?
No. A cell containing a space is not empty, so COUNTBLANK does not count it. You would need to clean the data or use a formula that trims spaces first.
What is the difference between COUNTBLANK and COUNTIF with an empty string?
COUNTBLANK counts truly empty cells and also cells with formulas that return an empty string. COUNTIF with "" counts cells that are empty or contain an empty string, but behaviour can vary. For most audits, COUNTBLANK is the simpler choice.
Can COUNTBLANK work across multiple ranges?
No. COUNTBLANK accepts only one range argument. To count blanks across several separate ranges, add multiple COUNTBLANK formulas together, for example =COUNTBLANK(A2:A10)+COUNTBLANK(C2:C10).
Why does COUNTBLANK return zero when I can see empty cells?
Those cells probably contain a formula that returns an empty string, or a hidden character such as a space. Check the formula bar for each cell to confirm.
Related functions
Every example on this page was recalculated by SheetSkill’s spreadsheet engine. COUNTBLANK reference