Function Problems

Excel: Count Blank Cells Between Data Rows in a Column

John WilsonJohn Wilson Nov 12, 2026 868 views

Question details

Find a formula that counts blank cells between populated rows in one Excel column.

Count Blank Cells Between Data Rows in an Excel Column
Product
Microsoft Excel
Device & OS
not provided
Scenario
The user has data in a single column and needs a running count of empty cells that occur before each subsequent populated row.
Observed behavior
The desired result is to display the number of blank cells between data rows while leaving blank source rows without a result.
Before you start

Place the source values in column A, with the first data row starting in A1. Use an empty helper column, such as column B, for the running blank-cell count.

Solution 1Recommended

Use a helper formula to count blanks between populated rows

Use this method when you need the number of blank cells between each pair of populated rows in column A.

The formula returns a result only when the current cell in column A contains data. It calculates the blank cells above the current data row and subtracts counts already returned for earlier data rows.

1
Set up the helper column

Leave B1 empty or enter 0 in B1, then select cell B2 next to the second row of your data.

2
Enter the running count formula

Type =IF(A2="","",COUNTBLANK(A$1:A1)-SUM(B$1:B1)) in B2 and press Enter.

3
Fill the formula down

Drag the fill handle from B2 down the helper column, or double-click the fill handle to copy the formula alongside the data range.

4
Read the results at populated rows

Check the values in column B where column A contains data. Each displayed number is the count of blank cells since the preceding populated row.

Use a helper formula to count blanks between populated rows
Formula behavior: Blank cells in column A remain blank in column B. The first populated row does not need a count; later populated rows show the number of intervening blank cells.
WPS Spreadsheets formula tools

Count Blank Cells Between Data Rows with WPS Spreadsheets

WPS Spreadsheets supports COUNTBLANK and standard Excel-compatible formulas, so you can calculate blank cells between data rows with the same helper-column approach and fill the formula down quickly.

  1. 1. Open the worksheet in WPS Spreadsheets: Launch WPS Office, choose Spreadsheets, and open your .xlsx or .xls workbook.
  2. 2. Choose a helper cell: Click B2, or the cell beside the second row of the source data in column A.
  3. 3. Enter the blank-count formula: Type =IF(A2="","",COUNTBLANK(A$1:A1)-SUM(B$1:B1)) and press Enter.
  4. 4. Copy the formula down: Select B2 and drag its fill handle downward to apply the formula to the remaining rows.
Use COUNTBLANK to identify empty cells between populated records.Fill formulas down a column with the familiar fill handle.Open and edit Microsoft Excel .xlsx and .xls files with formula compatibility.Use a lightweight spreadsheet interface with familiar Excel-style tools.
microsoft office alternative - wps office

Frequently Asked Questions

What formula counts all blank cells in an Excel column?

Use COUNTBLANK with the required range, such as =COUNTBLANK(A:A) for the entire column or =COUNTBLANK(A1:A100) for a specific range.

How do I count only the blank rows between two entries in column A?

Put =IF(A2="","",COUNTBLANK(A$1:A1)-SUM(B$1:B1)) in B2 and fill it down. Results appear only on populated rows in column A.

Why does the helper formula return a blank cell instead of zero?

The IF(A2="","",...) portion intentionally returns an empty result when A2 is blank. This prevents every blank source row from showing a repeated calculation.

Does COUNTBLANK count cells that contain a formula returning an empty string?

Yes. COUNTBLANK treats cells containing formulas that return "" as blank. If you need to exclude those formula results, use a different condition-based formula.