Practice free

SHEETS function

SHEETS counts the sheets in a workbook or in a 3-D reference and returns that number. Hidden sheets are counted too, so the total can be higher than the tabs you see.

Example

Read it as a sentence: count how many sheets the reference to B1 on the Items sheet covers, which gives 1.

Practice this in the app

Syntax

SHEETS([reference])

Arguments in [square brackets] are optional.

reference (optional)
A reference spanning sheets; omit for the whole workbook.

Returns: The number of sheets.

What Excel actually returns

Each formula below was run in desktop Excel. The result is exactly what the cell showed, errors included.

FormulaExcel showsCase
=SHEETS() 6 Workbook count
=SHEETS(Items!B1) 1 Single reference
=SHEETS(Data:Cases!A1) 6 3D reference
=SHEETS(5) #N/A Number

The Items sheet these formulas read

Watch out for

  • Counts hidden sheets too.

Where it works

Excel
SHEETS arrived in Excel 2013. Older versions do not have it.
Google Sheets
Same name, same behaviour for everyday use. Added to Sheets later; check your edition.

Part of Information functions. Every result on this page was measured in desktop Excel, build 16.0.20527. Last updated .