Function Problems

Test Whether Every Cell in an Excel Range Is Blank or Zero

Jason MillerJason Miller Nov 18, 2026 868 views

Question details

Determine whether every cell in a spreadsheet range is blank or contains zero, and return one result for the entire range.

Test Whether Every Cell in an Excel Range Is Blank or Zero
Product
Microsoft Excel
Device & OS
not provided
Scenario
A user wants to check a large range, such as B1:B3000, and return A if all cells are blank or zero, or B otherwise.
Observed behavior
The OR function returns a single TRUE or FALSE value rather than testing the blank-or-zero condition separately for each cell.
Before you start

Identify the range to check and choose a result cell outside it. Confirm whether cells containing formulas that return an empty string should count as blank.

Solution 1Recommended

Use SUMPRODUCT to check every cell in the range

Use this formula to return A only when every cell in a single-column range is blank or zero.

SUMPRODUCT evaluates the blank and zero comparisons for each cell, then counts the cells that meet either condition. The result is compared with the number of rows in the range.

1
Select a result cell

In Excel, click an empty cell outside B1:B3000, such as C1.

2
Enter the formula

In the formula bar, enter =IF(SUMPRODUCT(--(((B1:B3000="")+(B1:B3000=0))>0))=ROWS(B1:B3000),"A","B") and press Enter.

3
Check the result

Read the result cell: A means every cell is blank or zero; B means at least one cell does not meet either condition.

4
Adjust the range if needed

Replace each occurrence of B1:B3000 in the formula bar with your single-column range. For a range spanning multiple columns, replace ROWS(range) with ROWS(range)*COLUMNS(range).

Use SUMPRODUCT to check every cell in the range
Empty strings and errors: Cells with formulas that return an empty string are treated as blank. Error values in the checked range can cause the formula to return an error instead of A or B.
Check ranges in WPS Spreadsheets

Check a Range for Blanks or Zeros in WPS Spreadsheets

Use the same SUMPRODUCT formula in WPS Spreadsheets to test each cell and return one result for the whole range.

  1. 1. Open your spreadsheet: Open WPS Spreadsheets and choose File > Open to select your workbook.
  2. 2. Choose a result cell: Click a cell outside the range you want to check, such as C1 when checking B1:B3000.
  3. 3. Enter the formula: In the formula bar, enter =IF(SUMPRODUCT(--(((B1:B3000="")+(B1:B3000=0))>0))=ROWS(B1:B3000),"A","B") and press Enter.
  4. 4. Review the result: Check the result cell for A or B, and replace B1:B3000 in the formula if your data is in a different range.
Test large ranges for blanks or zeros with one formula.Open and edit Microsoft Excel XLSX and XLS files.Use a familiar spreadsheet interface for formulas and worksheets.Work with a free, lightweight office suite.
microsoft office alternative - wps office

Frequently Asked Questions

Why can't I use OR to test each cell separately?

OR combines its arguments into one TRUE or FALSE result. SUMPRODUCT can instead evaluate the blank-or-zero condition for each cell and count the matches.

Can I check a range with multiple columns?

Yes. Replace B1:B3000 with your range and replace ROWS(range) with ROWS(range)*COLUMNS(range) so the formula compares the match count with the total number of cells.

Does a formula returning an empty string count as blank?

Yes. The comparison range="" treats a cell whose formula returns an empty string as a match.

What if the formula returns an error?

Check the cells in the specified range for error values, such as #N/A or #DIV/0!. Those errors can propagate through the SUMPRODUCT formula.