Contact

SHEETS in Excel: Count Workbook Sheets and Three-Dimensional References

Information Intermediate Microsoft Excel

Count Excel sheets in a workbook or reference, understand hidden-sheet scope and audit three-dimensional ranges without confusing count with position.

Verification status: See the evidence and test scope described in this guide. How formula examples are checked

Quick answer: SHEETS() returns the number of sheets in the workbook containing the formula. Supplying a reference instead returns the number of sheets that reference spans. It counts sheets, not cells or visible tabs alone.

Syntax and optional reference

=SHEETS([reference])

Reference is optional. The no-argument call counts the workbook’s sheets. Microsoft explicitly includes visible, hidden and very hidden worksheets and other sheet types such as charts, macros and dialog sheets.

Do not confuse SHEETS with SHEET: SHEETS counts included sheets; SHEET returns one sheet’s position number. A workbook can have five sheets while a particular sheet is at position two.

Reproducible layout

Create a disposable workbook with exactly four worksheets in this order: Summary, Jan, Feb, Mar. There are no extra chart or hidden sheets in the primary fixture. The expected workbook count is four.

These are structural expectations from the stated layout, not captured Excel results. An existing workbook’s output depends on all of its included sheets and sheet types.

Example 1: whole workbook versus one-sheet reference

=SHEETS()
=SHEETS(Jan!A1)
=SHEETS(Jan!A1:D10)

Expected results are 4, 1 and 1. Expanding the referenced cell range from one cell to forty cells does not change the number of sheets it occupies.

This distinction matters when a workbook report labels a result “size.” A sheet count does not reveal row count, populated cells, data volume or file size.

Example 2: a three-dimensional reference

=SHEETS(Jan:Mar!A1)

Expected result: 3 in the specified order, spanning Jan, Feb and Mar. The range’s endpoints are sheet names, and the colon includes the sheets between them in workbook order.

A named range that refers to the same three-dimensional span can provide a readable argument, but its actual definition must be inspected. A familiar name alone does not prove that it still includes the intended sheets.

Advanced application: insert a sheet inside the span

In a separate copy, insert a worksheet named Adjustments between Feb and Mar. The workbook count becomes 5, and the Jan:Mar span contains 4 sheets: Jan, Feb, Adjustments and Mar.

The formula’s text can remain Jan:Mar while the included membership changes. A count control can reveal a structural change, but a count of three alone cannot prove that the intended three sheet names are present; an unintended replacement could preserve the count.

Advanced application: hidden sheets are still included

In the original four-sheet fixture, hiding Feb leaves an expected workbook count of 4 and Jan:Mar span count of 3, because hidden sheets remain in the documented scope.

A visible-tab inventory can therefore undercount the workbook. Before interpreting a discrepancy, check whether the report intended all sheets or only a particular visible subset. SHEETS does not supply a “visible only” switch.

Advanced check: structural count versus aggregation

SHEETS(Jan:Mar!A1) reports how many sheets the reference spans. It does not add the values stored in their A1 cells, validate that those cells exist as meaningful measurements, or confirm that each monthly sheet has the same layout.

If a three-dimensional sum is also used, audit both the set of included sheets and the target cell meaning. A correct count can coexist with a wrong aggregate if one sheet stores a different metric in the referenced cell.

Errors and troubleshooting

Microsoft documents #REF! when reference is invalid. Check deleted endpoint sheets, malformed references and named-range definitions before replacing the error with a number.

If the count is larger than the visible tabs, remember the hidden and nonworksheet scope. If a three-dimensional count changes after insertion or movement, inspect which sheets lie between its endpoints. If a single-sheet reference returns one despite many cells, that matches its purpose.

The Object Model note in the reference says similar object-model functionality already exists; it does not remove the worksheet function. Native editing behavior, external-reference boundaries, special sheet types and application-specific recalculation were not executed in this guide.

Availability and version history

  • Current documentation: the dedicated Microsoft reference lists Excel for Microsoft 365, Excel for Microsoft 365 for Mac, Excel 2024, Excel 2024 for Mac, Excel 2021, Excel 2021 for Mac, Excel 2019, Excel 2016.
  • Introduced: Microsoft’s alphabetical catalog marks SHEETS as introduced in Excel 2013. Exact first build and platform-specific introduction dates remain unverified.
  • Last functioning version: unknown; a current help listing is not a last-working-build test.
  • Evidence checked: October 15, 2026. Official documentation was freshly retrieved; examples were independently calculated. No native Excel, Mac or web-client execution was performed.

References and verification

Examples use English function names and comma separators. Expected numbers are rounded independent mathematical calculations; documented error expectations are labeled as such. They are not captured Excel output. All illustrative data and policies are fictional.