Documentation/Calc Functions/SHEETS

Function name:
SHEETS

Category:
Spreadsheet

Summary:
Determines the number of sheets in a given reference, given the current arrangement of tabs in the Sheet tabs area at the bottom of Calc's main window. If you do not specify a reference, returns the number of sheets currently in the spreadsheet.

Syntax:
SHEETS([Reference])

Returns:
Returns a positive integer that is the current number of sheets in the given reference or the spreadsheet.

Arguments:
Reference is a specific cell reference (for example, "$'Employee Data'.A4"), a specific cell range (for example, "$Sales.A3:D12"), or the name of a named or database range.


 * If Reference is omitted, SHEETS returns the total number of sheets currently in the spreadsheet.


 * Reference is not dereferenced – the contents of any cells within the referenced area has no significance.


 * If Reference comprises multiple cell ranges, then SHEETS reports a parameter list error (Err:504).

Additional details:

 * If a valid Reference argument is supplied, SHEETS returns the current number of sheets within that reference. If the arrangement of tabs in Sheet tabs area is subsequently changed, SHEETS could then return a different value.


 * Calc provides a facility to hide a sheet, so that its tab is not visible in the Sheet tabs area at the bottom of Calc's main window. Hidden sheets are taken into account when determining the number of sheets in a reference and the name of a hidden sheet can be used in the Reference argument.


 * A common cause of confusion arises from the default naming applied by Calc to new sheets, for example Sheet1, Sheet2, Sheet3, and so on. There is no relationship between any digit(s) that appear in the name of a sheet and the value returned by SHEETS. For example,  may return 3 if it happens that Sheet1, Sheet2, and Sheet3 are the three entries at the left of the Sheet tabs area; however, the same formula may return some other value if the tabs in the Sheet tabs area are arranged differently.

Related LibreOffice functions:
COLUMNS

ROWS

SHEET

ODF standard:
Section 6.13.32, part 2

Equivalent Excel functions:
SHEETS