Formula Errors

Fix Excel COUNTIF Returning #VALUE! Across Multiple Worksheets

Huma Ashraf ChHuma Ashraf Ch Nov 25, 2026 868 views

Question details

Count cells greater than zero across multiple Excel worksheets without a #VALUE! error.

Fix Excel COUNTIF Returning #VALUE! Across Multiple Worksheets
Product
Microsoft Excel
Device & OS
not provided
Scenario
The user wants to count cell R43 when it is greater than zero on each worksheet from Sheet1 through Sheet5.
Observed behavior
The formula =COUNTIF(Sheet1:Sheet5!R43,">0") returns #VALUE!.
Before you start

Check the exact worksheet names and confirm that R43 is the cell you want to test on each sheet. If you use a sheet list, place it in unused cells on the worksheet containing the formula.

Solution 1Recommended

Use a worksheet list with SUMPRODUCT and INDIRECT

Use this approach when you have many worksheets and want to maintain their names in a list.

COUNTIF does not directly accept a three-dimensional reference such as Sheet1:Sheet5!R43. INDIRECT builds an individual reference for each listed worksheet, and SUMPRODUCT adds the results.

1
List the worksheet names

On the worksheet containing your result, enter the exact names Sheet1 through Sheet5 in cells M1:M5, one name per cell.

2
Enter the counting formula

Select the result cell and enter =SUMPRODUCT(COUNTIF(INDIRECT("'"&SUBSTITUTE($M$1:$M$5,"'","''")&"'!R43"),">0")), then press Enter.

3
Adjust the list if needed

For 19 worksheets, enter their names in M1:M19 and change $M$1:$M$5 in the formula to $M$1:$M$19. Change R43 if you need to test a different cell.

Use a worksheet list with SUMPRODUCT and INDIRECT
Check sheet names: Each listed name must match an existing worksheet; a blank or incorrect name can cause a reference error. The formula counts cells whose numeric values are greater than zero.
Count across worksheets in WPS

Count values across worksheets with WPS Spreadsheet

In WPS Spreadsheet, add separate COUNTIF results to count cells greater than zero across worksheets without using an unsupported 3D COUNTIF reference.

  1. 1. Open the workbook: Open WPS Spreadsheet and use Open to select your Excel workbook.
  2. 2. Check the sheet names: Review the worksheet tabs and confirm the names of the sheets containing the cells you want to count.
  3. 3. Add the COUNTIF formula: Select a result cell and enter =COUNTIF(Sheet1!R43,">0")+COUNTIF(Sheet2!R43,">0"). Add another COUNTIF term for each additional sheet.
  4. 4. Save the workbook: Press Enter to calculate the count, then use File > Save or Save As to save your changes.
Count the same cell across multiple worksheetsOpen and edit Microsoft Excel XLSX and XLS filesUse familiar spreadsheet formulas and worksheet tabs
microsoft office alternative - wps office

Frequently Asked Questions

Why does COUNTIF return #VALUE! for Sheet1:Sheet5!R43?

Excel COUNTIF does not directly support the 3D worksheet reference Sheet1:Sheet5!R43. Use individual sheet references or build them from a worksheet-name list with INDIRECT.

Can I use the sheet-list formula for 19 worksheets?

Yes. Enter the 19 exact worksheet names in M1:M19, then change the sheet-list range in the SUMPRODUCT formula to $M$1:$M$19.

What if a worksheet name contains spaces or an apostrophe?

Enclose the sheet name in single quotes in a direct reference, such as 'Sales East'!R43. For the sheet-list formula, SUBSTITUTE doubles any apostrophes in the listed name.

Does the formula count zero or blank cells?

No. The criterion ">0" counts numeric values greater than zero; zero and blank cells are not counted.