Information
SHEETS Function in Excel
Returns the number of sheets in a reference.
Syntax
- =SHEETS([reference])
Arguments
- reference (optional): Reference (default: all sheets in workbook)
Examples
- =SHEETS() - Total sheets in workbook - Result: 5
Defensive formulas with SHEETS
- Use IS* functions inside IF to branch on blank, error, text, or number cells.
- Prefer [IFERROR](/functions/iferror/) when you only need a fallback display value.
- Error hub: [Fix formula errors](/guides/fix-excel-formula-errors/).
Common errors
- Counts only worksheet tabs
Use cases
- Workbook analysis
- Dynamic formulas
- Documentation
Frequently asked questions
- What is SHEETS used for in Excel? SHEETS() returns the total number of worksheets in the workbook. Useful for documentation, creating dynamic formulas that adapt to workbook structure, and validating that expected sheets exist.
- Does SHEETS count chart sheets and hidden sheets? SHEETS counts all worksheet tabs including hidden sheets. It does NOT count chart sheets (standalone charts). For a workbook with 5 worksheets (2 hidden) and 1 chart sheet, SHEETS() returns 5.
- How do I loop through all sheets with SHEETS? Use SHEETS() as the upper limit: =INDIRECT("Sheet"&ROW()&"!A1") copied down for SHEETS() rows. Or with SEQUENCE in Excel 365: =INDIRECT("Sheet"&SEQUENCE(SHEETS())&"!A1") creates references to A1 on all sheets.
Editorial review
- Reviewed by Excel.Directory Editorial Team. Updated May 2026.