SHEETS(reference)
=SHEETS(Sheet1:Sheet2!A1)
The SHEETS function is a useful tool for quickly getting the number of sheets in a workbook. This example returns 2 because it takes the second sheet in the workbook as the reference.
=SHEETS(Sheet1:Sheet3!A1)
The SHEETS function can also be used to return the number of sheets in a range. This example returns 3 because it takes the third sheet in the workbook as the reference.
=SHEETS()
The SHEETS function can also be used to return the number of sheets in a workbook without a range. This example returns the number of sheets in the workbook.
The SHEETS function enables users to quickly identify the total number of sheets in a given reference, including visible, hidden, and very hidden worksheets. The reference argument is optional.