To count blank cells in Excel, use the COUNTBLANK function: =COUNTBLANK(A1:A10). For more advanced counting (e.g., blank cells that meet another condition), use COUNTIFS with the criteria "" or SUMPRODUCT with ISBLANK. This article explains each method, when to use it, and how to handle cells that look blank but aren’t.
What Counts as a Blank Cell?
Excel treats a cell as blank if it contains nothing at all—no formula, no space, no apostrophe, no zero-length text. However, a cell that contains a formula returning "" (empty text) is not blank to COUNTBLANK; it counts as a text value. Similarly, a cell with a space character (" ") is not blank. This distinction is the most common source of confusion when counting blanks.
Method 1: COUNTBLANK – The Simple Way
The COUNTBLANK function counts cells that are truly empty, including cells with formulas that return ""? Actually, no—COUNTBLANK counts cells that are empty, but it also counts cells that contain formulas returning an empty string ""? Let’s be precise: In Excel, COUNTBLANK counts cells that are empty or contain formulas that return an empty string. Yes, that’s correct—COUNTBLANK treats a formula returning "" as blank. However, it does not count cells with a space character (a space is a non-blank text).
Syntax: =COUNTBLANK(range)
Example: With data in A1:A10 where A2, A5, and A7 are empty, =COUNTBLANK(A1:A10) returns 3.
Method 2: COUNTIFS – When You Need Conditions
If you need to count blank cells only when another column meets a condition, use COUNTIFS. The criteria for blank is "" (two double quotes with nothing between). For example, to count rows where column B is blank and column A says “Pending”:
With data in A1:A10 and B1:B10, enter: =COUNTIFS(A1:A10,"Pending",B1:B10,"")
This returns the number of rows where A is “Pending” and B is blank. Note: COUNTIFS with "" counts cells that are truly empty or contain formulas returning "", but it does not count cells with a space. If you want to exclude formulas returning empty text, you’d need a different approach.
Method 3: SUMPRODUCT + ISBLANK – For Complex Logic
When conditions are more complex than COUNTIFS can handle, use SUMPRODUCT with ISBLANK. ISBLANK returns TRUE only for truly empty cells—it does not count formulas returning "". So if you need to count only truly empty cells that also meet another condition, this is the way.
Example: Count rows where column A is “Pending” and column B is truly empty (no formula):
With data in A1:A10 and B1:B10, enter: =SUMPRODUCT((A1:A10="Pending")*(ISBLANK(B1:B10)))
This multiplies the two arrays of TRUE/FALSE, converting them to 1/0, and sums the result. If there are 2 such rows, it returns 2.
Why Cells That Look Blank Aren’t Counted
You might have a column that appears empty, but COUNTBLANK returns 0. Common culprits:
- Spaces: A cell with a space character (e.g., from imported data) is not blank. Use
=TRIM(A1)to remove spaces, or find them with=LEN(A1)(if it returns 1, it’s a space). - Formulas returning
"": If a formula returns an empty string,COUNTBLANKcounts it as blank, butISBLANKdoes not. Decide which behavior you need. - Non-breaking spaces: Sometimes imported data contains character 160 (non-breaking space).
TRIMdoesn’t remove those; use=SUBSTITUTE(A1,CHAR(160),""). - Invisible characters: Other non-printing characters can make a cell look blank. Use
=CLEAN(A1)to remove them.
Counting Non-Blank Cells: COUNTA
Often you want the opposite—count cells that are not blank. Use COUNTA. It counts cells that contain any data, including numbers, text, errors, and formulas returning ""? Actually, COUNTA counts cells that are not empty, but it does not count cells with formulas that return ""? Let’s be accurate: COUNTA counts cells that contain any type of information, including error values and empty text (""). So a formula returning "" is counted. If you want to count cells that have actual numbers, use COUNT (numbers only).
Example: To count non-blank cells in A1:A10, use =COUNTA(A1:A10). If A1:A10 contains 7 values and 3 blanks, it returns 7.
Frequently Asked Questions
How do I count blank cells in a filtered list?
If you have applied a filter, COUNTBLANK still counts all blank cells in the range, not just the visible ones. To count visible blank cells, use SUBTOTAL with function 109 (COUNTA) on the range, then subtract from the total visible rows. For example, if A1:A10 is filtered, =SUBTOTAL(103,A1:A10) counts visible non-blank cells, and =SUBTOTAL(3,A1:A10) counts visible non-empty cells? Actually, function 103 counts visible non-blank cells, and function 3 counts visible cells that are not hidden, but it includes blanks? The correct way: Use =SUBTOTAL(103,A1:A10) to count visible non-blank cells, then subtract from the total visible rows (which you can get with =SUBTOTAL(3,A1:A10)—but that counts visible cells including blanks? Let’s simplify: Use a helper column with a formula like =IF(A1="",1,0), then filter and use SUBTOTAL(109,helper) to sum visible 1s. That’s the reliable method.
Why does COUNTIF(A1:A10,””) not work?
It does work—it counts blank cells in the range, but it behaves like COUNTBLANK (counts formulas returning ""). If you want to count only truly empty cells, use SUMPRODUCT(--ISBLANK(A1:A10)).
How do I count blank cells in Google Sheets?
Google Sheets has the same COUNTBLANK function: =COUNTBLANK(A1:A10). It works similarly, but note that in Google Sheets, COUNTBLANK also counts cells with formulas returning ""? Actually, in Google Sheets, COUNTBLANK counts cells that are empty or contain empty strings, just like Excel. The syntax is identical.
Can I count blank cells with a condition using COUNTIFS?
Yes, as shown above, use "" as the criteria. For example, =COUNTIFS(B:B,"",A:A,"Yes") counts rows where B is blank and A is “Yes”.
What if my blank cells contain formulas that return “”?
If you want to count those as blank, use COUNTBLANK or COUNTIF with "". If you want to exclude them, use SUMPRODUCT with ISBLANK.
How do I count blank cells in a pivot table?
Pivot tables don’t have a built-in “count blanks” option. Instead, add a helper column to your source data with a formula like =IF(A2="",1,0), then add that column to the pivot table as a sum field.
Alternative: Using Excel Tables and Structured References
If your data is in an Excel Table (Insert > Table), you can use structured references. For example, if your table is named Table1 and you want to count blanks in column A, use =COUNTBLANK(Table1[Column1]). This works the same as normal ranges but automatically adjusts as you add rows.
Common Errors and Troubleshooting
- #VALUE! error: Usually happens if the range includes entire columns (e.g., A:A) and there’s an error value in a cell? Actually,
COUNTBLANKdoesn’t return errors, butSUMPRODUCTmight if there are text values where numbers are expected? No,ISBLANKworks fine. If you get #VALUE!, check for merged cells or array entry issues. - Counting blanks in a row: Use
COUNTBLANK(A1:F1)to count blanks across a row. - Counting blanks in multiple ranges: You can’t use
COUNTBLANKwith multiple ranges directly, but you can add them:=COUNTBLANK(A1:A10)+COUNTBLANK(C1:C10).
Remember, the key is understanding what “blank” means in your context. Use COUNTBLANK for a quick count, COUNTIFS for conditional counts, and SUMPRODUCT with ISBLANK when you need to distinguish truly empty cells from those with empty text formulas.
Related
- BigQuery SELECT from Multiple Tables: 4 Ways
- Traffic Light PLC Program: How It Works
- DB10DL 10.8V Lithium Ion Micro Driver Drill Guide
Try it: the Formula Explainer: paste any formula and see each function and reference in plain English.
More in Formulas & functions
- Excel LAMBDA in Name Manager: How to Create and Use ItYes. In Microsoft 365 Excel for Windows, you can save a LAMBDA formula as a defined name in…
- M Code in Function: What It Is & How to Use ItYes, “M code” in a function refers to the M language used inside Power Query (Excel’s Get &…
- How to Set an Absolute Cell Reference in Excel FormulasTo set an absolute cell reference in Excel, add a dollar sign before both the column letter and…
- Python split() Function: How It Works with ExamplesThe split() method in Python divides a string into a list of substrings based on a specified separator,…
- Round to Nearest Thousand in Excel: ROUND, ROUNDUP, ROUNDDOWNTo round a number to the nearest thousand in Excel, use the ROUND function with -3 as the…
- Count Unique Values in Excel: Formulas and MethodsTo count distinct, nonblank values in Excel for Microsoft 365, use =ROWS(UNIQUE(FILTER(A2:A20,A2:A20<>""))). This assumes the values are in…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.