Category: FUNCTION | Updated: 2026-11-22
How to Use the SHEETS Function | Get the Total Number of Sheets in a Spreadsheet
Syntax
=SHEETS([reference])
- reference (optional): You can specify a target range, though in Google Sheets the argument is usually omitted to retrieve the total number of sheets in the entire file.
Practical Table Example
This example uses a file containing four sheets: “Table of Contents”, “Summary”, “Data 1”, and “Data 2 (Hidden)”.
| Use Case | Formula | Result | Explanation |
|---|---|---|---|
| Get total sheet count | =SHEETS() |
4 |
Total number of sheets including 1 hidden sheet |
| Create page numbering | ="Sheet " & SHEET() & " of " & SHEETS() |
Sheet 1 of 4 |
Combined with SHEET to build a table of contents |
Common Errors and Precautions
- Behavior when referencing a single sheet: Specifying a range within a single sheet such as
=SHEETS(A1:B10)returns1. To get the sheet count for the entire workbook, always leave the argument empty as=SHEETS(). - Cannot get sheet counts of other files: You cannot directly pass the URL or ID of another Google Sheets file to count its sheets.
Frequently Asked Questions
Q. Does the SHEETS function include hidden sheets in the total count?
A. Yes, it returns the total count including both visible sheets and sheets set to hidden.
Q. Can you pass an argument to the SHEETS function in Google Sheets?
A. Typically, you omit the argument and use '=SHEETS()' to get the total number of sheets in the current spreadsheet.