Contact

SHEET Function (LibreOffice Calc)

Lookup Intermediate LibreOffice Calc

Learn the SHEET function in LibreOffice Calc: Returns the internal sheet number of a reference or a string.

Verification status: Official documentation referenced; example outcomes independently reasoned or arithmetically checked where stated. Not executed in LibreOffice Calc. How formula examples are checked

Validation scope: Native results below refer to saved LibreOffice Calc 25.2.3.2 Linux evidence from 13 October 2026 at 17:06–17:07 UTC. This later review checked the scripts and artifact hashes, 37 saved ODS/result comparisons, and 41 independent sheet-order/count calculations. Intermediate mutation stages are attributed saved observations; their final ODS state agrees with the log. Calc was not rerun for this review.

What SHEET does—and what it does not do

SHEET returns the 1-based worksheet position of a reference or a worksheet named by a text string. The first tab is 1, the second is 2, and so on. Called with no argument, it returns the position of the sheet containing that very formula. It does not return the text name of the sheet, count sheets, inspect cell contents, or provide a permanent identification code. Moving a tab changes its position. The official definition also states that hidden sheets are included in the numbering, so the third tab may be hidden even though the visible tabs appear adjacent. LibreOffice Calc Help — Spreadsheet Functions, SHEET; OpenDocument 1.4 OpenFormula, §6.13.31, both consulted 2026-10-13.

For example, in a workbook with tabs Overview, Sales 2026, HiddenData (hidden), and Archive, the formula =SHEET("Archive") returns 4. The workbook includes four sheets, even though a user may only see three tabs.

Exact Calc syntax, argument and default

=SHEET([Reference])
Argument Required? Accepted meaning Default if omitted
Reference No A reference to a cell/range in this document, or a text string with an existing sheet name, such as "Archive". The sheet containing the SHEET() formula.

The square brackets in the Help syntax mean the argument is optional; do not type the square brackets. There is one optional argument and no other option or numeric default. SHEET() works on a blank sheet; the value inside the referenced cell is irrelevant. A cross-sheet reference such as Archive.A1 uses Calc’s period before the cell address, not an Excel-style exclamation mark when using Calc A1 syntax. A name containing spaces needs apostrophes around the sheet name: 'Sales 2026'.A1. The text-name form instead uses double quotes: "Sales 2026". Calc Help — SHEET; Calc Help — Referencing a Cell in Another Sheet, consulted 2026-10-13.

These examples use English function names, a period for the sheet/cell separator, and semicolon argument separation in the native-tested Calc configuration. Function names, decimal marks and argument separators can be localized or configured. Confirm your own formula-syntax settings rather than copying an Excel formula’s separators blindly. Here, SHEET takes at most one argument, so semicolon separation matters chiefly when nesting it inside another function. Calc Help — Spreadsheet Functions, consulted 2026-10-13.

Quick start: find your current tab number

Type this in any empty cell of the sheet you are viewing:

=SHEET()

In the four-tab demonstration workbook, the formula returns 1 on Overview, 2 on Sales 2026, and 4 on Archive. On the third, hidden sheet, the position is 3 (tested with an explicit reference). These are positions within that workbook, not universal numbers. All three default cases above were native-tested in Calc 25.2.3.2. The optional-argument behavior is also explicitly defined in OpenFormula §6.13.31 (consulted 2026-10-13).

Build a reproducible four-tab workbook

  1. Create a blank Calc document. Rename the first sheet Overview.
  2. Add three sheets in this order: Sales 2026, HiddenData, Archive.
  3. On each sheet, enter 123 in cell A1 (the content itself is not used by SHEET).
  4. Hide HiddenData using the sheet tab’s Hide command; do not delete it.
  5. On Overview, paste the formulas below into separate empty cells.
Formula on Overview Expected result Why
=SHEET() 1 Position of Overview itself.
=SHEET(Overview.A1) 1 Referenced sheet is first.
=SHEET('Sales 2026'.A1) 2 Quoted sheet name contains a space.
=SHEET("HiddenData") 3 Hidden tab is still numbered.
=SHEET(HiddenData.A1) 3 Equivalent reference form for the hidden sheet.
=SHEET("Archive") 4 Text naming the fourth sheet.
=SHEET(B2:C4) 1 Local range has no explicit sheet prefix.
=SHEET(Overview.A1:Archive.D5) 1 Multi-sheet reference returns its first sheet’s position.
=SHEET('Sales 2026'.A1:Archive.D5) 2 First sheet of this 3D reference is position two.

All nine workbook formulas and their expected results were verified natively in the recorded Calc fixture (tested 2026-10-13); the last two are also expressly covered by OpenFormula’s first-sheet rule. The official specification says a reference is not dereferenced: changing A1 from 123 to any other value should not change the sheet number. OASIS OpenFormula §6.13.31, consulted 2026-10-13.

Reference versus name string: a subtle but important distinction

The two formulas below can return the same value:

=SHEET(Archive.A1)
=SHEET("Archive")

The first argument is a worksheet reference; the second is a literal text name. They behave differently if a sheet is renamed. In a separate native edit scenario, renaming Archive to Historic updated the first formula to =SHEET(Historic.A1) and it continued to return 2, its position at that moment. The literal =SHEET("Archive") stayed unchanged and returned Err:502 because that name no longer existed. This exact behavior was observed in Calc 25.2.3.2 on 2026-10-13, not established as a cross-program guarantee. For formulas that must survive ordinary tab renames, prefer a direct reference when practical.

Reference a named sheet using INDIRECT

This more advanced formula returned 3 in the fixture:

=SHEET(INDIRECT("HiddenData.A1"))

INDIRECT interprets the supplied text as a reference before SHEET evaluates it. Do not confuse this with =SHEET("HiddenData.A1"), which is a sheet-name string containing a cell address and is not the same contract. The nested example was native-tested, but it also introduces the text-reference maintenance risks of INDIRECT. See INDIRECT and ADDRESS for constructing references safely.

Advanced use: label stages of a workbook with their tab positions

If each workflow step occupies a separate worksheet, place =SHEET() in cell B1 of each sheet, with A1 containing Step in workbook. When the sheets appear in the intended order, the result becomes a simple position indicator. This can help explain why data-entry tabs may appear out of order after someone moves them.

However, do not use SHEET() alone as a stable transaction identifier. The native worksheet-mutation test showed the number for Archive changing 4 → 5 → 2 as a tab was inserted and Archive was moved. During the same test, a reference to HiddenData changed from 3 → 4 → 5. Those changes are expected for positions, not evidence that any record was deleted. For stable identifiers, create your own immutable ID column instead.

Use SHEET with SHEETS to check a position

On the first tab of the four-sheet fixture:

=SHEET()<=SHEETS()

This is a logical consequence of the two documented functions; it is not a separately tested example in the evidence file. It checks that the current sheet’s 1-based position does not exceed the workbook’s sheet count. This is normally true and therefore not a strong integrity check; it is mostly useful for demonstrating the relationship. For a stronger check, compare =SHEET("Archive") with an expected ordinal only if your template deliberately fixes tab order. SHEETS guide explains document-wide and multi-sheet counting.

Errors, limits and troubleshooting

Problem or formula Native Calc 25.2 observation / fix
=SHEET("MissingSheet") Err:502 when the literal sheet name did not exist; verify the exact tab name.
=SHEET("") Err:502; use a valid name or omit the argument entirely.
=SHEET(123) Err:504; use a cell reference or an existing sheet-name string, not a sheet number.
=SHEET(Overview.A1;Archive.A1) Err:504; documented syntax allows only one optional argument.
=SHEET('Sales 2026'.A1) gives an error Check single-quote placement around a sheet name containing spaces and the Calc . sheet separator.
Result seems too large Check for hidden tabs and sheets inserted before the target; both count toward the ordinal.
Result changed after moving a tab Expected: SHEET returns the current order, not a permanent ID.
Sheet-name formula fails after a rename A quoted text constant does not automatically change to the new name; prefer a direct cell reference.

The error codes above were recorded from direct native entry, not inferred from Excel. LibreOffice’s Error Codes identifies 502 as an invalid argument and 504 as a parameter-list error (consulted 2026-10-13). Exact error presentation can differ by locale, release or import pathway. For in-workbook troubleshooting, inspect the formula bar and confirm the sheet actually exists.

Limits and important non-claims: OpenFormula specifies a result of at least 1, excludes references containing an external Source Location, and returns an error if SHEET is evaluated outside a table cell. External-workbook syntax and evaluation outside the sheet grid were not tested here. This function does not return the last sheet in a multi-sheet range: it returns the first. Text-only sheet-name inputs are supported for SHEET, unlike the documented argument type for SHEETS. OpenFormula §6.13.31, consulted 2026-10-13.

Compatibility, naming and verification scope

SHEET is the function name in the LibreOffice Calc Help and OpenFormula 1.4 standard; the present research found no documented alternative Calc alias to justify a separate page. Do not conflate SHEET with SHEETS, which counts worksheets, or the Calc Sheet menu, which performs UI actions. Its syntax in the tested environment is =SHEET([Reference]) (brackets only indicate optionality in documentation).

Native execution was performed in LibreOffice Calc 25.2.3.2, Linux, through the LibreOffice UNO formula property, not through Excel import. The official current Help page consulted on October 13, 2026 displayed a LibreOffice 26.8 Help header. Its presence is documentation evidence, not a claim that 26.8 was locally installed or tested. Direct execution in Windows, macOS, Excel, Google Sheets, older LibreOffice releases or a non-English locale was not tested. OpenFormula standardization provides useful interoperability context but is not an independent execution test in another program.

  • SHEETS — number of worksheets in a reference or the whole document.
  • ROWS and COLUMNS — dimensions in a cell range, not tab positions.
  • ROW and COLUMN — row and column indices, not sheet indices.
  • INDIRECT and ADDRESS — build or resolve cell references.
  • AREAS — number of distinct cell areas, not sheets.

Claim-level official sources and validation record

  1. Definition, no-argument default, optional name/reference, examples: LibreOffice Calc Help — Spreadsheet Functions (SHEET), read 2026-10-13.
  2. 1-based number; hidden sheets; multi-sheet references use first sheet; external-Source Location constraint: OASIS OpenDocument 1.4 — OpenFormula §6.13.31 SHEET, read 2026-10-13.
  3. Cross-sheet Calc A1 notation; apostrophes for names containing spaces: LibreOffice Calc Help — Referencing a Cell in Another Sheet, read 2026-10-13.
  4. Error-code meanings: LibreOffice Calc Help — Error Codes, read 2026-10-13.
  5. Experimental observations only: saved dated test records and supporting ODS/script artifacts. 25 numerical assertions across SHEET and SHEETS combined passed; 7 additional invalid-input diagnostics were observed. The mutation experiment is distinct and is not included in the 25 assertions.