SHEETS function
Returns the number of sheets in a reference, or in the whole workbook when no reference is given. Hidden sheets are included.
Available in Excel 2013 and later, Microsoft 365, Excel for the web
Excel 2013 and laterWorks in Google Sheets
Syntax
SHEETS([reference])| Argument | What it means | |
|---|---|---|
reference | Optional | A reference, often a 3-D reference such as Jan:Mar!A1. If omitted, all sheets in the workbook are counted. |
Returns: A whole number of sheets.
How SHEETS works
SHEETS counts sheets. With no argument it returns the total number of sheets in the workbook, including hidden ones, so it is a quick check that a monthly reporting file has all twelve months plus its summary. With a 3-D reference such as Jan:Dec!B5 it counts how many sheets that reference spans, which is helpful to make sure a 3-D total like =SUM(Jan:Dec!B5) really covers the tabs you think it covers.
A common use is a control cell on a summary sheet: =IF(SHEETS()=13, "OK", "Check tabs"). If someone deletes a month or adds a scratch sheet, the warning appears. For the position of a single sheet rather than a count, use SHEET.
Examples
1Count all sheets in the workbook
| A | |
|---|---|
| 1 | 4 |
Result: 4
Assuming the tabs Summary, Jan, Feb and Mar, SHEETS returns 4. A hidden sheet would raise the count.
2Sheets covered by a 3-D range
| A | |
|---|---|
| 1 | |
| 2 | 3 |
Result: 3
The 3-D reference runs from Jan to Mar, three tabs, so the result is 3. If a new sheet is dragged between Jan and Mar, the count — and every 3-D SUM over that span — changes with it.
Common errors and how to fix them
| Error | Why it happens | Fix |
|---|---|---|
#REF! | The reference is not valid, e.g. one of the named sheets does not exist. | Check the sheet names in the 3-D reference. |
Tips
- Sheets placed between the first and last tab of a 3-D reference are always included — keep scratch sheets outside that span.
- To list sheet names, VBA or Power Query is needed; formulas can count sheets but not list them.
Google Sheets
SHEETS also exists in Google Sheets and works the same way for everyday use, so the examples above work there too.
SHEETS in other languages
In a non-English version of Excel the function has a local name. Excel translates formulas automatically when a file is opened in another language.
| Language | Function name |
|---|---|
| Danish | ARK.FLERE |
| Dutch | BLADEN |
| Finnish | TAULUKOT |
| French | FEUILLES |
| German | BLÄTTER |
| Hungarian | LAPOK |
| Italian | FOGLI |
| Norwegian (Bokmål) | ANTALL.ARK |
| Polish | ARKUSZE |
| Portuguese (Brazil) | PLANS |
| Portuguese (Portugal) | FOLHAS |
| Russian | ЛИСТЫ |
| Spanish | HOJAS |
| Swedish | ANTALBLAD |
| Turkish | SAYFALAR |