The Excel SHEETS Function

Related Function:
SHEET Function

Function Description

The Excel Sheets function returns the number of sheets in a supplied reference. The result includes sheets that are Visible, Hidden or Very Hidden.

Note: the Sheets function was first introduced in Excel 2013 and so is not available in earlier versions of Excel.

The syntax of the function is:

SHEETS( [reference] )

Where the supplied [reference] argument is a reference for which you want to know the number of sheets. This is an optional argument which, if omitted, defaults to the current workbook.

Sheets Function Examples

The spreadsheets below show examples of the Excel Sheets function used in an Excel workbook that contains 3 sheets.

  A B
1 =SHEETS( ) - defaults to the current workbook
2 =SHEETS( A1 ) - a reference to a cell in the current worksheet
3 =SHEETS( Sheet1:Sheet2!A1 ) - a reference to cells in Sheet1 and Sheet2
  A B
1 3 - the current workbook has 3 sheets
2 1 - A1 refers to a range on just 1 sheet
3 2 - Sheet1:Sheet2!A1 refers to a range on 2 sheets

For further examples of the Excel Sheets function, see the Microsoft Office website.