TechBuzzPro

Count Errors in All Sheets? Excel Fix

· 6 min read · Apps & Browsers

In this article
  1. Why Excel Lacks a One-Click Error Counter
  2. Method 1: The 3D SUM Formula (No VBA)
  3. Method 2: A Simple VBA Macro for a Full Workbook Count
  4. Method 3: Using Excel's Built-in Error Checking (Per Sheet)
  5. Common Problems and Misconceptions
  6. How to Choose the Right Method
  7. Alternatives: Power Query and Conditional Formatting
  8. Frequently Asked Questions

The short answer is no—Excel does not have a single built-in button that counts errors across all sheets at once. However, you can get a total error count for an entire workbook using a few formulas or a simple VBA macro, and this article explains every practical method in detail.

Why Excel Lacks a One-Click Error Counter

Excel’s built-in error-checking tools (like the green triangle indicators and the "Trace Error" button) work on the active cell or the current sheet only. The application was designed to help you fix one error at a time, not to audit an entire multi-sheet workbook in a single operation. This is a deliberate design choice—errors are meant to be resolved contextually, not just counted. However, for large workbooks with dozens of sheets, manually checking each one is tedious and error-prone. The methods below give you a complete count without needing third-party add-ins.

Method 1: The 3D SUM Formula (No VBA)

If your sheets are named consistently (e.g., Jan, Feb, Mar) and are adjacent in the tab order, you can use a 3D reference. This formula counts all error cells in a specific range across multiple sheets:

  1. Create a new sheet (or use an empty area on an existing one).
  2. Type this formula, replacing Sheet1:Sheet3 with your actual first and last sheet names, and A1:Z100 with the range you want to check:
=SUMPRODUCT(--ISERROR(Sheet1:Sheet3!A1:Z100))

This works because ISERROR returns TRUE for any error type (#N/A, #VALUE!, #REF!, etc.), the double negative converts TRUE/FALSE to 1/0, and SUMPRODUCT sums them across the 3D range. Important: This only works if the sheets are contiguous in the tab bar. If you have a summary sheet in between, it will be included in the count, which may or may not be what you want.

Method 2: A Simple VBA Macro for a Full Workbook Count

For a true "all sheets" count regardless of order or naming, VBA is the most reliable approach. Here’s a macro that counts every error cell in every worksheet and displays the total:

  1. Press Alt+F11 to open the VBA editor.
  2. Go to Insert > Module.
  3. Paste this code:
Sub CountAllErrors()
    Dim ws As Worksheet
    Dim rng As Range
    Dim errorCount As Long
    errorCount = 0
    For Each ws In ThisWorkbook.Worksheets
        For Each rng In ws.UsedRange
            If IsError(rng.Value) Then
                errorCount = errorCount + 1
            End If
        Next rng
    Next ws
    MsgBox "Total errors in workbook: " & errorCount
End Sub
  1. Press F5 to run it. A message box will show the total.

This macro checks every cell in the UsedRange of each sheet, so it won’t count empty cells. It also correctly handles all error types. If you want a per-sheet breakdown, you can modify the macro to print results to a new sheet instead of a message box.

Method 3: Using Excel's Built-in Error Checking (Per Sheet)

If you prefer not to use formulas or VBA, you can still get a count for a single sheet quickly:

  1. Click on the sheet tab you want to check.
  2. Press F5 (or Ctrl+G) to open the "Go To" dialog.
  3. Click Special.
  4. Select Formulas and then check only Errors under the "Formulas" section.
  5. Click OK. Excel will select all error cells on that sheet. The status bar at the bottom will show "Count: N" where N is the number of errors.

This is a fast way to count errors on one sheet, but you must repeat it for each sheet. It also selects the cells, making it easy to review them.

Common Problems and Misconceptions

  • Errors in hidden sheets: The VBA method counts them; the 3D formula only counts sheets in the reference. The Go To Special method requires you to unhide the sheet first.
  • Errors in merged cells: The VBA method counts a merged cell as one error, even if it spans multiple rows/columns. The 3D formula counts each cell in the merged range as an error, so results may differ.
  • Errors in array formulas: Both methods count them correctly, but the VBA macro might be slower on very large workbooks because it loops through every cell individually.
  • "Errors" vs. "bad data": These methods count actual Excel error values (#DIV/0!, #N/A, etc.). They do not flag cells with text that looks like an error, such as "N/A" typed as a string, or cells with inconsistent formulas (those green triangles).

How to Choose the Right Method

Your choice depends on your situation:

  • One-time count, sheets are adjacent: Use the 3D SUM formula. It’s quick and doesn’t require saving the workbook as a macro-enabled file.
  • Recurring need, or sheets are not adjacent: Use the VBA macro. It’s the most flexible and can be saved in your Personal Macro Workbook for use across all files.
  • You only need a quick look at one sheet: Use Go To Special. It’s the fastest way to see and count errors on the current sheet.
  • You want to see the errors themselves, not just count them: Go To Special selects the cells, so you can immediately see them. The VBA macro can be modified to list them, but that’s more advanced.

Alternatives: Power Query and Conditional Formatting

If you’re using Excel 2016 or later, Power Query (Get & Transform) can also help. You can load each sheet as a query, then use a custom column with try and otherwise to flag errors, but this is overkill for a simple count. A more practical alternative is conditional formatting: set a rule to highlight all error cells (using ISERROR in a formula), then use the filter by color feature to count them. This is visual and doesn’t require VBA, but it still works per sheet unless you apply the rule to all sheets simultaneously (which you can do by selecting all sheet tabs before applying the rule).

Frequently Asked Questions

Can I count errors across all sheets without VBA?

Yes, if your sheets are adjacent, you can use a 3D reference with SUMPRODUCT and ISERROR. If they are not adjacent, you’ll need to either rearrange your sheets, use VBA, or manually sum counts from each sheet using the Go To Special method.

Why does my formula count errors in empty cells?

If you use a 3D formula over a fixed range like A1:Z100, it counts errors in any cell in that range, even if the cell appears empty but contains a formula that returns an error. If you want to count only errors in cells that are actually used, you’ll need to adjust the range or use VBA with UsedRange.

Does the VBA macro work on .xlsx files?

No. To use VBA, you must save the workbook as a macro-enabled file (.xlsm). If you save as .xlsx, the macro will be lost. You can still run the macro temporarily, but you’ll need to save as .xlsm to keep it.

How do I count only specific error types, like #N/A?

Replace ISERROR with a specific check, such as ISNA for #N/A. For example: =SUMPRODUCT(--ISNA(Sheet1:Sheet3!A1:Z100)). In VBA, you can check rng.Value against CVErr(xlErrNA).

Can I use these methods in Google Sheets?

Yes, the SUMPRODUCT and ISERROR approach works in Google Sheets, but the range must be specified per sheet (e.g., =SUMPRODUCT(--ISERROR(Sheet1!A1:Z100))+SUMPRODUCT(--ISERROR(Sheet2!A1:Z100))). Google Sheets does not support 3D references like Excel. The VBA macro does not work in Google Sheets; you would use Apps Script instead.

Why is the count different when I use Go To Special vs. the VBA macro?

Go To Special counts only cells that are visible and on the active sheet. The VBA macro counts all cells in the UsedRange, including hidden rows/columns and cells with errors that might be filtered out. Also, Go To Special counts each cell, but if a cell contains an array formula that returns multiple errors, it counts them as one, while VBA might count them separately depending on how you loop.