SHEETS Function (OpenOffice Calc)
Count sheets with SHEETS in OpenOffice Calc. Compare a whole workbook, a single-sheet reference and a contiguous three-dimensional range.
Verification status: Eight ordinary SHEETS examples were recalculated in Apache OpenOffice 4.1.16 on Linux x86-64, Build 9816, using a generated three-sheet ODF workbook. Saved identities, typed results and both controls were checked. No manual-entry, XLSX-import or other-release execution is claimed. How formula examples are checked
Quick answer: =SHEETS() produced 3 in the Apache OpenOffice 4.1.16 check below.
Availability and version history
- Introduced: First release not established; documented by OpenOffice.org 3.3.
- Supported in: Apache OpenOffice 4.1.16; no final supported release is established.
- Scope: English desktop Calc, semicolon-separated formulas and local workbook references.
- Checked: October 14, 2026. Eight examples were recalculated in 4.1.16 on Linux x86-64, Build9816. Generated-ODF identities, saved results and controls were checked; no manual-entry or different-release test is claimed.
What SHEETS returns
SHEETS returns the number of sheets in the workbook when called without an argument. With a reference, it counts the sheets spanned by that reference. It does not count rows, cells or individual reference areas. Release implementation.
Syntax and arguments
SHEETS([Reference])
Reference is optional. Omission counts all workbook sheets in the inspected implementation. The documented ordinary form and tested examples use either no argument or one cell/range reference.
Reproducible setup
Create three sheets, in order, named Reference, Inputs and Archive. Place the examples on Reference. The count is structural: Inputs.A1=20 and Archive.A1=30 are ordinary data values, not sheet-count inputs.
Eight checked examples
All eight formulas were recalculated. Quotation marks identify text results; unquoted #N/A identifies an error. Logical tests in the explicitly number-formatted output cells are shown as 1/0. Reference expectations follow the inspected callback, workbook structure and ordinary arithmetic.
| Formula | Independent/source reference | Saved 4.1.16 result |
|---|---|---|
=SHEETS() |
3 |
3 |
=SHEETS(H2) |
1 |
1 |
=SHEETS(Inputs.A1) |
1 |
1 |
=SHEETS(Archive.A1) |
1 |
1 |
=SHEETS(Inputs.A1:Archive.A1) |
2 |
2 |
=SHEETS(H2:H3) |
1 |
1 |
=SHEETS(Inputs.A1:Archive.B2) |
2 |
2 |
=SHEETS(Reference.H2:Archive.A1) |
3 |
3 |
Practical worksheet
=SHEETS() returns 3 for this workbook. =SHEETS(Inputs.A1) returns 1, because that reference lies on one sheet. The referenced number 20 does not affect the answer.
For a consolidation covering Inputs through Archive, =SHEETS(Inputs.A1:Archive.A1) returns 2. A sheet-count check can help describe the intended consolidation span, but it does not verify that every sheet contains the expected fields or usable values.
Advanced interpretation and checks
The inspected range branch counts the inclusive interval between the first and last sheet indices. Inputs is second and Archive is third, so 3−2+1 gives 2. Extending the range from Reference to Archive gives 3−1+1 = 3.
Changing the row/column rectangle does not change this count. The displayed Inputs.A1:Archive.B2 case still spans two sheets. The last example was saved with its row/column endpoint coordinates normalized to a bounding rectangle; its first and last sheets remained Reference and Archive, and its count remained 3.
A single rectangular range H2:H3 is one sheet even though it includes two cells. Conversely, AREAS can report one contiguous three-dimensional area while SHEETS reports multiple sheets. SHEET answers yet another question: the position of a sheet, rather than the number spanned.
Boundaries and troubleshooting
Do not count sheets by counting nonblank cells or by assuming a naming sequence has no gaps. The workbook’s actual structure and the reference’s sheet endpoints determine these results.
The no-argument callback reads the document’s sheet count without a visibility filter in the inspected source. Hidden-sheet changes were not executed here, so the native evidence remains the visible three-sheet workbook. Multiple separately supplied arguments, reference lists, external workbooks and structural-edit scenarios were also not executed. Use the documented zero-or-one-reference form unless a different interface has been separately verified.
Related functions
Official evidence and checking scope
- Function-specific implementation
- Release function description and argument metadata
- English function identity
The generated ODF was opened in the native GUI, hard-recalculated and saved separately. The informational “Not all attributes could be read” load warning was retained. A deliberately stale SUM cache refreshed to 3, and an uncached SUM returned 7. The exact local inputs, sheet order, formula identities and saved values were reconciled. The authoring-tool XLSX and its previews were not used as native calculation evidence. Only the listed cases and release are covered.