SHEET Function in ONLYOFFICE Spreadsheet Editor: Count or Identify Worksheet Tabs
Practical SHEET guide for ONLYOFFICE: official syntax, optional argument, exact reproducible three-tab worksheet, changing tab order, errors and edition limitations.
Verification status: Official documentation referenced; example outcomes independently reasoned or arithmetically checked where stated. Not executed in ONLYOFFICE Spreadsheet Editor. How formula examples are checked
At a glance: =SHEET([value]). SHEET([value]) returns the worksheet number for a particular sheet. With its optional value omitted, ONLYOFFICE says it uses the current sheet; with value, the vendor specifies a sheet name or reference. Number here is a worksheet/tab position, not the contents of a cell and not the number of worksheets in the workbook. The official function page gives this definition.
Use this function to locate an active sheet in a multi-tab workbook, construct a visible tab-position indicator, or check whether a referenced sheet was moved. Avoid confusing it with the similarly named SHEETS function, which counts worksheets instead.
Exact documented syntax, argument order and defaults
SHEET([value])
| Position | Name | Type | Required? | Default / omitted behaviour |
|---|---|---|---|---|
| 1 | value |
A worksheet name or sheet/cell reference; vendor allows omission, returning the current sheet number. | No | Current worksheet number. |
The square brackets in the vendor help indicate an optional argument; do not literally type [ or ] into a normal zero-argument formula. Example: =SHEET().
Evidence boundary: The official help defines value semantically, but does not separately demonstrate every text-literal, renamed-tab or external-workbook reference grammar. Examples here favour editor-generated cell references. The behaviour of SHEET("Costs") and 3-D references is proposed for native testing, not claimed from the source. The source does not specify locale-dependent names or a first-supported Docs/web or Desktop version. The general function-entry help instructs a leading = and formula arguments in parentheses; the empty call has no separator issue.
Build the sample workbook from scratch
The walkthrough starts with a newly created workbook and deliberately tracks tab position, not the numeric values stored in cells. The official sheet-management guide says a fresh workbook starts with one worksheet, a plus button inserts a sheet, and a tab can be renamed or moved. All example outputs below are structural expectations from the staged workbook, not an observation made inside ONLYOFFICE.
- Create a new spreadsheet in ONLYOFFICE. Its initial worksheet is normally labelled
Sheet1; if yours has a different name, rename it to Plan by double-clicking the tab, enteringPlan, and pressing Enter. - Click the sheet-tab plus button twice. Rename the second tab Costs and the third Summary. Verify the left-to-right tab order is now
Plan/Costs/Summarybefore continuing. If your editor inserts a sheet elsewhere, use the Move or copy dialog to enforce this order. - In Plan!A1, type the text
plan row; in Costs!A1, typecost row; and in Summary!A1, typesummary row. These values deliberately do not affect sheet numbers or counts. - Put the formula shown in each scenario into the indicated empty cell. Press Enter and record what the actual app displays. The right-hand expected result is derived from the tab arrangement; it must not be mistaken for a test result already observed.
- For later scenarios, move the Plan tab to the right of Summary using the documented Move or copy operation; order becomes
Costs/Summary/Plan. Then insert one new tab and rename it Notes at the end, giving four tabs. Keep a copy of the three-tab workbook if you want to repeat the initial checks independently.
The formula examples assume the English function names shown in official help, with no function argument separator needed for the empty-call examples. When a cross-sheet reference is used, the examples use an unquoted tab without spaces (Costs!A1). To test a sheet name with spaces, rename a tab and select the source cell using the argument-picker UI rather than guessing a localized quoted syntax.
Reproducible scenario table and expected results
| Checkpoint | Required tab order | Enter in cell | Formula | Expected structural value | Why |
|---|---|---|---|---|---|
| 1. Three tabs: Summary selected | Plan / Costs / Summary |
Summary!B2 |
=SHEET() |
3 | Current sheet third from left; official empty-argument rule. |
| 2. Three tabs: Plan selected | Plan / Costs / Summary |
Plan!B2 |
=SHEET() |
1 | Current sheet first from left. |
| 3. Three tabs: Costs selected | Plan / Costs / Summary |
Costs!B2 |
=SHEET() |
2 | Current sheet second from left. |
| 4. Reference to first tab from Summary | Plan / Costs / Summary |
Summary!B3 |
=SHEET(Plan!A1) |
1 | The value argument is a sheet reference; count begins at first. |
| 5. Reference to middle tab from Plan | Plan / Costs / Summary |
Plan!B3 |
=SHEET(Costs!A1) |
2 | Named tab location is second. |
| 6. Reference to last tab from Plan | Plan / Costs / Summary |
Plan!B4 |
=SHEET(Summary!A1) |
3 | Target reference on final tab. |
| 7. After moving Plan to far right | Costs / Summary / Plan |
Plan!B5 |
=SHEET() |
3 | Moved current tab occupies third position. |
| 8. After moving Plan: Costs position | Costs / Summary / Plan |
Summary!B5 |
=SHEET(Costs!A1) |
1 | Old second sheet becomes first after moving Plan. |
| 9. After moving Plan: Summary position | Costs / Summary / Plan |
Summary!B6 |
=SHEET() |
2 | Original last tab is now middle tab. |
| 10. After adding fourth tab Notes | Costs / Summary / Plan / Notes |
Notes!B2 |
=SHEET() |
4 | New last tab occupies fourth position. |
| 11. Existing Plan after adding Notes | Costs / Summary / Plan / Notes |
Plan!B6 |
=SHEET() |
3 | Adding tab at end does not itself move Plan. |
| 12. Reference to Costs after adding Notes | Costs / Summary / Plan / Notes |
Notes!B3 |
=SHEET(Costs!A1) |
1 | Tab index determined by target, not caller. |
How to interpret this table: These outcomes are independently derived from the documented sheet-number/sheet-count definitions and the explicitly stated tab arrangement. Rows containing =SHEET(Plan!A1), =SHEET(Costs!A1) or =SHEET(Summary!A1) extrapolate the vendor’s documented reference-argument purpose to the concrete sample workbook and need native validation of this exact reference syntax. They are not results observed by executing ONLYOFFICE, and a wrong tab order makes the expected numbers wrong. Restore the order shown in each row before copying the formula.
Advanced formula patterns and interpretation
A navigation indicator. Place =SHEET() in Summary!D2 of the original three-tab workbook. The structural expectation is 3. If you wish to show the number with a prefix, use ="Tab "&SHEET() in D3, with expected text Tab 3 if the editor evaluates concatenation normally. The vendor’s individual SHEET help documents only the SHEET operation; rendering of the whole nested expression remains unexecuted.
Compare the selected tab with a referenced one. On Summary!D4, use =SHEET()-SHEET(Costs!A1). With original positions Summary=3, Costs=2, the mathematical difference is 1. After moving Plan to the far right, Summary=2 and Costs=1; the difference remains 1. This relative-position relationship is useful for workbook checklists, but positions change when users reorder tabs.
Is this the first tab? The proposed conditional =IF(SHEET()=1,"First tab","Later tab") in Plan before moving it expects First tab; after moving Plan to the end it expects Later tab. This is a compound-formula example, not an observation proving this exact combination in a particular build.
Number vs count. In the initial workbook on Costs, =SHEET() has expected result 2, whereas =SHEETS() has expected result 3. If you confuse the two, a two-tab report may be mislabelled as three or vice versa.
Order-sensitive report references. If a control dashboard relies on a tab’s ordinal position, document who can reorder tabs and whether added/hidden sheets are allowed. A stable worksheet name reference is usually safer for calculations than a changing position number; SHEET should be used for identification, auditing and labels, not as a permanent unique database key.
Troubleshooting: Sheet order and reference pitfalls
What if SHEET() changes after reordering? Its subject is the current sheet number; moving tabs changes the ordinal identity. Record the sheet arrangement when comparing two calculations.
What if =SHEET(Costs!A1) fails? Verify the Costs tab exists; click its A1 cell via the reference-picker UI; confirm whether the actual editor inserted quoted or otherwise canonical syntax. Do not replace this with unverified Excel-only syntax.
What if a sheet name contains spaces? Use the editor-generated reference rather than manually inventing a localized quoting rule. The official page does not present a cross-locale grammar table.
What if a deleted sheet is referenced? The function page does not document the resulting error string. Preserve the exact displayed result and workbook context if tested; do not assume a specific #REF! or #VALUE! label from another spreadsheet.
Wrong argument count: The documented form has just one optional argument. Do not supply two sheet names as separate arguments, e.g. =SHEET(Plan,Costs), based on a guess. Cross-sheet range syntax must be independently established. Text, blanks, named ranges, external links and non-sheet references: The vendor help does not provide a complete coercion/error matrix. Native result/error strings for these cases remain unverified.
Recalculation and manual testing: Use the Formula ribbon’s calculation controls described in official function help; record product build number, platform (Docs web/Server versus Desktop), source workbook tab order, supplied argument text and exact displayed result. This allows the manuscript to be upgraded from documentation evidence to reproducible native verification.
Compatibility and historical versions
ONLYOFFICE offers Docs Spreadsheet Editor and separate Desktop Editors; the reviewed function article is an unversioned English reference rather than a release-by-release capability matrix. A current function listing does not prove availability in older major versions, browser-embedded variants, or localized installations. This review contains zero application-native executions. Similarly, other spreadsheets’ reference parsing and hidden-tab semantics must not be treated as evidence of ONLYOFFICE behaviour.
When sharing a workbook, test these formulas in the actual recipient’s build and locale.
Related official documentation (checked 2026-10-13 UTC)
- ONLYOFFICE — SHEET reference — documented name, purpose, optional parameter and omitted-argument rule.
- ONLYOFFICE — SHEETS reference — complementary count or position function; a separate canonical function, not an alias.
- Manage sheets in ONLYOFFICE — add, rename, move, copy, hide, and show tabs.
- Insert Spreadsheet Editor functions — formula entry, arguments and calculation controls.
Evidence and testing limits
DOCUMENTATION CHECKED: English syntax, optional argument, semantic purpose and omitted-argument behaviour in the dated vendor pages. INDEPENDENT STRUCTURAL EXPECTATIONS: integers in the table computed from staged tab positions and counts, not from running the editor. UNTESTED: application output, quoted or 3-D reference syntax, hidden-sheet and external-workbook semantics, error labels and version-specific behaviour. The worksheet tables show derived expectations, not screenshots or native test results.