Function Problems

Count Nonblank Cells Next to Blank Cells in Excel and WPS Spreadsheets

Camila MilosovichCamila Milosovich Nov 22, 2026 871 views

Question details

Count populated cells in one range only when the corresponding cells in an adjacent range are blank.

Count Nonblank Cells Next to Blank Cells in Excel and WPS Spreadsheets
Product
Microsoft Excel and WPS Spreadsheets
Device & OS
not provided
Scenario
A user wants to count cells in A1:A10 only when the matching cells in B1:B10 are blank.
Observed behavior
The desired result is a count of rows where column A is nonblank and the corresponding cell in column B is blank.
Before you start

Check that the two ranges cover the same rows and have the same dimensions. Choose an empty cell outside those ranges for the result.

Solution 1Recommended

Use SUMPRODUCT to Count Matching Rows

Use this formula to test both conditions row by row and return a single count.

SUMPRODUCT evaluates whether each cell in column A is nonblank and its corresponding cell in column B is blank. The double minus signs convert those results to numbers for counting.

1
Select a result cell

Open the worksheet in Excel or WPS Spreadsheets and click an empty cell outside A1:B10.

2
Enter the formula

Type =SUMPRODUCT(--(A1:A10<>""),--(B1:B10="")) into the selected cell or formula bar.

3
Calculate the count

Press Enter. The result counts only rows where the cell in A1:A10 is nonblank and the corresponding cell in B1:B10 is blank.

4
Adjust the ranges

To use different rows, edit both ranges in the formula bar so they start and end on corresponding rows.

Use SUMPRODUCT to Count Matching Rows
Check cells that look blank: A cell containing spaces is treated as nonblank. A formula that returns an empty string is treated as blank by these comparisons.
WPS Spreadsheets

Count Matching Rows in WPS Spreadsheets

Use SUMPRODUCT in WPS Spreadsheets to count nonblank cells only when their adjacent cells are blank.

  1. 1. Open your worksheet: Launch WPS Spreadsheets and open the workbook containing the two columns.
  2. 2. Choose a result cell: Click an empty cell outside the ranges you want to evaluate.
  3. 3. Enter the formula: Type =SUMPRODUCT(--(A1:A10<>""),--(B1:B10="")) in the selected cell, adjusting both ranges if needed.
  4. 4. View the result: Press Enter to display the count of qualifying rows.
Count two conditions across corresponding rows with one formulaOpen and edit Microsoft Excel XLSX filesUse a familiar spreadsheet interfaceGet started with WPS Office for free
microsoft office alternative - wps office

Frequently Asked Questions

Does the formula count a zero in column A?

Yes. A numeric zero is nonblank, so it is counted if the corresponding cell in column B is blank.

What happens if a cell contains a formula that returns an empty string?

The comparisons treat the empty string as blank. That row is excluded if it appears in column A and can qualify if it appears in column B.

Why is a cell that looks blank not being treated as blank?

It may contain spaces or other characters. Click the cell and inspect the formula bar, then remove unwanted characters if appropriate.

Can I use ranges other than A1:A10 and B1:B10?

Yes. Replace both ranges in the formula with ranges of the same size that cover corresponding rows, such as A2:A20 and B2:B20.