Available in:All versions (Works in Excel 2007, every later version, Microsoft 365 and Excel for the web)Examples need Excel 2021 or laterCategory:StatisticalUnder review

COUNTBLANK

AANTAL.LEGE.CELLEN in Dutch Excel

Counts the empty cells in one range, including cells that hold empty text from a formula, but not cells with a space or a 0.

Difficulty rating 1 of 5. One argument, but it counts cells that look empty, which is not the same as the cells ISBLANK calls empty, and the difference decides your result.

Last updated: 13 October 2026

See the worked examples

Sheet excerpt: E2 holds the formula
RowABCDE
1Invoice no.CustomerVAT codeWithout VAT code
2F-25-1001Hoekstra Installatie BVV2133=COUNTBLANK(C2:C8)=COUNTBLANK(C2:C8)
3F-25-1002Smit Groothandel BV
4F-25-1003Van Dijk Transport BVV21
5F-25-1004De Boer Metaal BV
6F-25-1005Kaya Elektro BVV09
7F-25-1006Mulder Gereedschappen
8F-25-1007Raman KlimaattechniekV21
Formula cell (E2)Input

Result: 3

=COUNTBLANK(C2:C8)
=COUNTBLANK(C2:C8)

What COUNTBLANK does and when to use it

What it does: it counts the empty cells in one range, for example the sales invoices that have no VAT code.

When to use it: for completeness checks on exports: gaps in a column, or the share of lines not yet counted (divide by ROWS). For empty cells under a condition use COUNTIFS.

How Excel evaluates it

Excel goes through every cell of the range once. A cell counts when it has no content at all, or when it holds empty text.

The function then returns the total as a whole number. A block such as B2:D9 is counted as one range, cell by cell.

Watch out: A cell with a space or a 0 is not counted, however empty it looks on screen. COUNTBLANK counts only cells with no content or with empty text.

Terms used on this page: range, cell

COUNTBLANK(range)
COUNTBLANK(range)
Arguments
ArgumentTypeMeaning
rangeRequiredThe cells to count the empty ones in.

Return value:The number of empty cells in the range, as a whole number

Formulas use commas (,) between arguments, as in English Excel. Formulas use semicolons (;) between arguments, as in Dutch Excel. Formulas use commas (,) between arguments, as in English Excel; Dutch Excel uses semicolons (;).

Worked examples

Beginner

Count sales invoices without a VAT code

You are recalculating VAT on the sales invoices of Veldhuis Installatie BV. The extract has a VAT code column, but some invoices were booked without one. Before you start, you want one number: how many invoices have no code.

Sheet excerpt: E2 holds the formula
RowABCDEF
1Invoice no.CustomerVAT codeWithout VAT code
2F-25-1001Hoekstra Installatie BVV2133=COUNTBLANK(C2:C8)=COUNTBLANK(C2:C8)
3F-25-1002Smit Groothandel BV
4F-25-1003Van Dijk Transport BVV21
5F-25-1004De Boer Metaal BV
6F-25-1005Kaya Elektro BVV09
7F-25-1006Mulder Gereedschappen
8F-25-1007Raman KlimaattechniekV21
9
Formula cell (E2)Input

Formula in E2

=COUNTBLANK(C2:C8)
=COUNTBLANK(C2:C8)

Result: 33

Step by step
  1. COUNTBLANK has one argument, range. Here it is C2:C8, the VAT code of the 7 invoices.
  2. Excel goes through the cells from top to bottom. C2 holds V21: counted nothing. C3 is empty: the count becomes 1. C4 holds V21: still 1.
  3. C5 is empty: the count becomes 2. C6 holds V09: still 2. C7 is empty: the count becomes 3. C8 holds V21: still 3.
  4. The result is 3: invoices F-25-1002, F-25-1004 and F-25-1006 have no VAT code. Type a code in C3 and the result becomes 2 without touching the formula.

Watch out: If the range stops one row early, for example C2:C7, the last invoice is not counted at all. Check that the range covers every data row.

More on this example: why it works

Why it works

The function looks only at whether each cell in the range is empty and counts the ones that are. It does not care what the other cells contain, so the count follows the data as soon as a gap is filled or a new one appears.

Intermediate

Express the uncounted stock lines as a percentage

During the stock count at year end the quantity column of the inventory list (voorraadlijst) is filled in by hand. Some lines are still open. A 0 means someone counted the shelf and found nothing; an empty cell means nobody counted it yet.

You want to report what share of the lines has not been counted.

Sheet excerpt: E2 holds the formula
RowABCDEF
1ItemDescriptionCounted quantityNot yet counted
2S-201Cement 25 kg404037.5%37,5%=COUNTBLANK(C2:C9) / ROWS(C2:C9)=COUNTBLANK(C2:C9) / ROWS(C2:C9)
3S-202Plywood 18 mm
4S-203Wood screws 4x4000
5S-204Paint white 10 L1818
6S-205Safety gloves
7S-206Ladder 3 m66
8S-207Drill bits set
9S-208Work lamp2222
10
Formula cell (E2)InputNote: C3 and C8 are empty. C6 holds empty text, as left behind by a formula that returned "" and was pasted as values. C4 holds a typed 0.

Formula in E2

=COUNTBLANK(C2:C9) / ROWS(C2:C9)
=COUNTBLANK(C2:C9) / ROWS(C2:C9)

Result: 37.5%37,5%

Step by step
  1. Excel evaluates COUNTBLANK(C2:C9) first. It goes through the 8 cells: C2 holds 40, C3 is empty (1), C4 holds 0, C5 holds 18, C6 holds empty text (2), C7 holds 6, C8 is empty (3), C9 holds 22. The count is 3.
  2. The 0 in C4 is not counted: it is a value, and the shelf was counted. The empty text in C6 is counted, even though the cell is not truly empty.
  3. ROWS(C2:C9) returns the number of rows in the range: 8.
  4. The division is 3 / 8 = 0.375. Formatted as a percentage, E2 shows 37.5%: more than a third of the stock lines has not been counted.
  5. Fill in C3 with a quantity and the result drops to 2 / 8 = 25%. Without the division by ROWS you would only see 3 or 2, a number with no reference size.

Watch out: The cell shows 0.375 until you format it as a percentage. The value is right; only the display is not.

More on this example: why it works, 1 more pitfall, 1 variation

Why it works

COUNTBLANK supplies the numerator and ROWS supplies the size of the whole range, so the fraction stays correct if rows are added inside the range. The count treats a counted 0 as filled in, which is exactly what this scenario needs.

More to watch out for

  • If the list gets new rows below C9, the range does not grow. Convert the list to a table, or include the new rows in the range.

Variations

=1 - COUNTBLANK(C2:C9) / ROWS(C2:C9)
=1 - COUNTBLANK(C2:C9) / ROWS(C2:C9)

The share that has been counted instead of the share still open: 62.5%.

Advanced

Find what share of the missing approvals sits on manual entries

An extract of 8 journal lines has an Approved by column with gaps. Manual entries (journal MEM) carry the highest risk, so the finding you want is not the number of gaps but the share of the gaps that sits on manual entries. COUNTBLANK gives the total; a second function must count only the MEM lines.

Sheet excerpt: E2 holds the formula
RowABCDEF
1EntryJournalApproved byShare on MEM
225-0801MEMJK50%50%=COUNTIFS(B2:B9, "MEM", C2:C9, "") / COUNTBLANK(C2:C9)=COUNTIFS(B2:B9; "MEM"; C2:C9; "") / COUNTBLANK(C2:C9)
325-0802VRK
425-0803MEM
525-0804INKMV
625-0805MEM
725-0806BNKRB
825-0807INK
925-0808MEM
10
Formula cell (E2)InputMarks: extra spaceNote: C3, C4, C6 and C8 are empty. C9 holds a single space, which looks empty but is not.

Formula in E2

=COUNTIFS(B2:B9, "MEM", C2:C9, "") / COUNTBLANK(C2:C9)
=COUNTIFS(B2:B9; "MEM"; C2:C9; "") / COUNTBLANK(C2:C9)

Result: 50%50%

Step by step
  1. Excel evaluates COUNTIFS first. Its first pair is B2:B9 and "MEM": the rows with journal MEM are 2, 4, 6 and 9, entries 25-0801, 25-0803, 25-0805 and 25-0808.
  2. The second pair is C2:C9 and "", the criterion for empty cells. Of the four MEM rows, C2 holds JK, C4 is empty, C6 is empty and C9 holds a space. The space does not match the criterion, so COUNTIFS returns 2.
  3. COUNTBLANK(C2:C9) counts the empty cells of the whole column: C3, C4, C6 and C8. The count is 4. C9 is not counted.
  4. The division is 2 / 4 = 0.5, shown as 50%. Half of the missing approvals belong to manual entries.

Watch out: C9 holds a space on a MEM line. Neither COUNTBLANK nor the "" criterion counts it, so the formula silently reports 50% where the true picture is 3 of 5 gaps, 60%. Test the column for spaces before you quote the percentage.

More on this example: why it works, 1 more pitfall, 2 variations

Why it works

COUNTBLANK takes one range and no conditions, so it can only give the total. COUNTIFS adds the condition on the journal column, and its "" criterion matches the same kind of empty cells as COUNTBLANK. Both count the same cells, which is why the two numbers can be divided.

More to watch out for

  • All ranges inside COUNTIFS must be the same size. B2:B9 against C2:C8 gives #VALUE!, and the mismatch slips through when the ranges are typed by hand.

Variations

=SUMPRODUCT((B2:B9 = "MEM") * (TRIM(C2:C9) = "")) / SUMPRODUCT(--(TRIM(C2:C9) = ""))
=SUMPRODUCT((B2:B9 = "MEM") * (TRIM(C2:C9) = "")) / SUMPRODUCT(--(TRIM(C2:C9) = ""))

Counts every cell that looks empty, so the space in C9 is included: 3 of 5, which is 60%. Choose this when the extract may contain spaces.

=COUNTIFS(B2:B9, "MEM", C2:C9, "")
=COUNTIFS(B2:B9; "MEM"; C2:C9; "")

Only the number of MEM lines without approver, 2, when the share is not needed.

MasterExcel 2021 or later (This example needs Excel 2021 or later)

Measure how far COUNTBLANK overstates completeness

The purchase invoice extract has a cost center column. COUNTBLANK reports 2 gaps in 8 lines, so the field looks 75% complete. Some cells hold only a space, though.

As the reviewer you want to state by how many percentage points the plain count overstates completeness, in one formula that others can follow.

Sheet excerpt: E2 holds the formula
RowABCDEF
1Invoice no.SupplierCost centerOverstatement
2I-25-2201Bakker Isolatie BVKP10025%25%=LET( field, C2:C9, n, ROWS(field), strictGaps, COUNTBLANK(field), visibleGaps, SUMPRODUCT(--(TRIM(field) = "")), (visibleGaps - strictGaps) / n )=LET( field; C2:C9; n; ROWS(field); strictGaps; COUNTBLANK(field); visibleGaps; SUMPRODUCT(--(TRIM(field) = "")); (visibleGaps - strictGaps) / n )
3I-25-2202Yilmaz Metaalwaren
4I-25-2203Peeters Verhuur
5I-25-2204Smits VerpakkingKP200
6I-25-2205Janssen Laswerk
7I-25-2206Visser KantoorserviceKP100
8I-25-2207Bosman SchoonmaakKP300
9I-25-2208Dekker Transport
10
Formula cell (E2)InputMarks: extra spaceNote: C3 is empty. C4 and C9 each hold a single space. C6 holds empty text, as left behind by a formula that returned "" and was pasted as values.

Formula in E2

=LET(
  field, C2:C9,
  n, ROWS(field),
  strictGaps, COUNTBLANK(field),
  visibleGaps, SUMPRODUCT(--(TRIM(field) = "")),
  (visibleGaps - strictGaps) / n
)
=LET(
  field; C2:C9;
  n; ROWS(field);
  strictGaps; COUNTBLANK(field);
  visibleGaps; SUMPRODUCT(--(TRIM(field) = ""));
  (visibleGaps - strictGaps) / n
)

Result: 25%25%

Step by step
  1. LET reads its arguments in pairs: a name, then a value. field stands for the range C2:C9 and n for ROWS(field), which is 8.
  2. strictGaps is COUNTBLANK(field). It counts the truly empty C3 and the empty text in C6, but not the spaces in C4 and C9. The value is 2.
  3. visibleGaps is SUMPRODUCT(--(TRIM(field) = "")). TRIM turns the spaces into empty text, and the comparison is TRUE for C3, C4, C6 and C9. The double minus makes them 1 and SUMPRODUCT adds them: 4. COUNTBLANK cannot be used here, because it needs a reference and TRIM builds an array.
  4. The last argument of LET is the calculation: (4 - 2) / 8 = 0.25.
  5. Read against the completeness figures: 1 - 2/8 = 75% by COUNTBLANK, 1 - 4/8 = 50% when spaces count as gaps. The plain count overstates completeness by 25 percentage points.

Watch out: The mirror-image mistake: ROWS(C2:C9) - COUNTA(C2:C9) looks like a gap count but returns 1, not 2. COUNTA counts the empty text in C6 as content, while COUNTBLANK counts it as a gap, so the two functions disagree on that cell.

More on this example: why it works, 1 more pitfall, 1 variation

Why it works

The two counts measure different things in the same range: COUNTBLANK follows what the cell contains, the TRIM test follows what the reader sees. LET names both, so the last line reads like the sentence of the finding.

Do not use this construction when the column is already clean or you only need the strict count: a bare COUNTBLANK is clearer there. To avoid the second count altogether, clean the column first (for example in Power Query), at the price of changing the data you are testing.

More to watch out for

  • TRIM leaves a non-breaking space (CHAR(160)) in place. A cell with only that character counts as filled in both counts, and the overstatement is silently too low.

Variations

=1 - SUMPRODUCT(--(TRIM(C2:C9) = "")) / ROWS(C2:C9)
=1 - SUMPRODUCT(--(TRIM(C2:C9) = "")) / ROWS(C2:C9)

The completeness itself with spaces counted as gaps: 50%. Use it when you only need that figure and not the comparison.

Common mistakes

Common mistakes
SymptomCauseFix
Fewer gaps counted than you can seeThe count is lower than the number of gaps you see. Some cells hold a single space, which looks empty but is not counted.Count the cells that look empty with SUMPRODUCT(--(TRIM(A2:A9)="")). The Master example compares the two counts.
COUNTBLANK and ISBLANK disagreeCOUNTBLANK and ISBLANK disagree: a cell with a formula that returns "" is counted by COUNTBLANK, while ISBLANK says FALSE for it.Know which question you are asking. COUNTBLANK asks 'how many cells show nothing as a result', ISBLANK asks 'is this cell truly empty'. State which one your finding rests on.
Formula rejected with two rangesCOUNTBLANK(B2:B9, D2:D9) is rejected, because the function takes exactly one range.Add two COUNTBLANK calls, COUNTBLANK(B2:B9) + COUNTBLANK(D2:D9), or use one range that covers both columns when the column in between should be counted as well.