Contact

SHEETS Function in ONLYOFFICE Spreadsheet Editor: Count or Identify Worksheet Tabs

Information Beginner ONLYOFFICE Spreadsheet Editor

Practical SHEETS guide for ONLYOFFICE: official syntax, optional argument, exact reproducible three-tab worksheet, changing tab order, errors and edition limitations.

Verification status: See the evidence and test scope described in this guide. How formula examples are checked

At a glance: =SHEETS([reference]). SHEETS([reference]) returns how many worksheets are contained in a reference. With its optional reference omitted, the official ONLYOFFICE help page says it returns the number of sheets in the current workbook. The singular SHEET is different: it returns a sheet’s number, not the total.

Use the zero-argument form for a workbook-level tab count, such as checking whether an expected set of reporting sheets was created. A caller on a different tab should observe the same workbook-level count when the worksheet inventory is unchanged, but this expectation has not been tested natively in this manuscript.

Availability and version history

  • Introduced: The original introduction version and date are not established by the official sources checked.
  • Availability: Documented in the current ONLYOFFICE Spreadsheet Editor help; no final working-version endpoint is established.
  • Scope: Docs and Desktop Editors release separately. This unversioned help does not establish availability in every older build, mobile client or deployment.
  • Checked: October 14, 2026, against the official function reference. Documentation check; not a new native test.

Exact documented syntax, argument order and defaults

SHEETS([reference])
Position Name Type Required? Default / omitted behaviour
1 reference A worksheet reference, optionally spanning multiple sheets; vendor allows omission, returning the number of sheets in the current workbook. No Number of sheets in the current workbook.

The square brackets in the vendor help indicate an optional argument; do not literally type [ or ] into a normal zero-argument formula. Example: =SHEETS().

Evidence boundary: The source describes a reference containing one or more sheets, but supplies no textual 3-D reference example or universal cross-workbook handling guarantee. SHEETS(Plan:Summary!A1) or hidden-sheet counting is not asserted as natively tested. The fully specified worksheet tutorial uses the documented no-argument form. 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.

  1. 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, entering Plan, and pressing Enter.
  2. 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 / Summary before continuing. If your editor inserts a sheet elsewhere, use the Move or copy dialog to enforce this order.
  3. In Plan!A1, type the text plan row; in Costs!A1, type cost row; and in Summary!A1, type summary row. These values deliberately do not affect sheet numbers or counts.
  4. 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.
  5. 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. First new workbook, no extra tabs Plan Plan!B2 =SHEETS() 1 Workbook has one sheet.
2. Three tabs, Plan selected Plan / Costs / Summary Plan!C2 =SHEETS() 3 Workbook total is three.
3. Three tabs, Summary selected Plan / Costs / Summary Summary!C2 =SHEETS() 3 Workbook total independent of current tab.
4. Three tabs, Costs selected Plan / Costs / Summary Costs!C2 =SHEETS() 3 Workbook total independent of current tab.
5. After moving Plan to the end Costs / Summary / Plan Plan!C3 =SHEETS() 3 Moving a tab is not adding or deleting a sheet.
6. After moving Plan, called from Summary Costs / Summary / Plan Summary!C3 =SHEETS() 3 Caller does not determine workbook total.
7. After adding Notes Costs / Summary / Plan / Notes Notes!C2 =SHEETS() 4 An inserted sheet increases the total by one.
8. After adding Notes, called from Plan Costs / Summary / Plan / Notes Plan!C4 =SHEETS() 4 Caller is not last tab but workbook total is four.
9. After adding Notes, called from Costs Costs / Summary / Plan / Notes Costs!C4 =SHEETS() 4 Workbook total four across tabs.
10. After deleting the Notes tab Costs / Summary / Plan Plan!C5 =SHEETS() 3 A deleted sheet reduces total.

How to interpret this table: These outcomes are independently derived from the documented sheet-number/sheet-count definitions and the explicitly stated tab arrangement. Every table row uses the documented omitted-argument workbook count. Single-sheet and multi-sheet reference arguments are discussed separately as hypotheses requiring native verification. They are not results observed by executing ONLYOFFICE, and adding or deleting tabs changes the expected count; reordering alone does not. Restore the order shown in each row before copying the formula.

Advanced workbook-audit patterns

Display current position and total. On Summary!D2 in the original workbook, propose =SHEET()&" / "&SHEETS(). Its structural target is text 3 / 3. After moving Plan to the far right, Summary becomes position 2 of 3, so the structural target becomes 2 / 3. The expression is an illustrative combination of separately documented functions, not a native test.

Check that a template has at least four tabs. Enter =IF(SHEETS()>=4,"Template ready","Add missing tabs") in any worksheet. In the three-tab state, expect Add missing tabs; after inserting Notes as a fourth tab, expect Template ready. This tests tab count, not tab names or data validity. Checking count alone cannot prove the intended sheets exist.

Refer to a single worksheet. The vendor says reference can specify sheets whose number is to be returned. A one-sheet reference such as =SHEETS(Costs!A1) has structural expectation 1, but this specific input form is not confirmed by the prose-only vendor page. Treat it as a recorded exploratory test, not a validated cross-edition promise.

Do not assume 3-D reference syntax is portable. A formula visually resembling =SHEETS(Plan:Summary!A1) is not included in the verified worksheet exercise. It could depend on 3-D reference syntax support, edition, quoting, or parsing. Generate the actual reference through the editor and record its accepted expression before relying on such a reference.

Hidden tabs and audit scope. The sheet management documentation describes hiding/unhiding tabs; the SHEETS function page does not specify how hidden tabs are counted. Do not claim a verified hidden-sheet count until testing a named build. Equally, the number of nonempty tabs is not what this function is documented to count.

Troubleshooting: Sheet count and reference pitfalls

Why did SHEETS() change? Confirm whether you inserted, copied, or deleted a tab. Moving a tab alone does not change the mathematical count.

Why does a hidden tab matter? The vendor documents the hiding action but not native SHEETS counting rules for hidden tabs. Record build and hide state before concluding whether the count includes it.

What if an optional reference fails to parse? Generate the reference with the argument picker, verify target sheets, and capture the editor’s exact error. The function reference does not assign an error message to every syntax error or invalid workbook.

What if you link to another workbook? This guide does not establish external link support, permissions or cross-workbook counting. Prefer the zero-argument workbook example for a guaranteed documentation-based learning path.

Wrong argument count: The documented form has just one optional argument. Do not supply two sheet names as separate arguments, e.g. =SHEETS(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.

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.