Contact

ROWS Function in ONLYOFFICE Spreadsheet Editor: Syntax and Worked Examples

Lookup and Reference Beginner ONLYOFFICE Spreadsheet Editor

Count the rows in a referenced area, audit imported table height and distinguish allocated positions from populated records.

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

Quick answer

Use =ROWS(A2:A7) to count the six row positions from row 2 through row 7. ROWS measures the height of a rectangular cell reference: it does not remove blank or filtered positions. This guide uses the documented English ONLYOFFICE ROWS reference, checked October 13, 2026. All worked example results are independent expected results, not native execution measurements.

What it does and what it does not do

Use ROWS when you need to know how tall a selected source block is, track a fill-down sequence, validate expected import dimensions, or calculate the capacity of a rectangular region. It is a structural measurement, not a count of nonempty entries. The dedicated official ROWS article defines the return value as the number of rows in a cell reference.

Exact official syntax and argument definitions

=ROWS(array)
Argument Required Type and purpose Default
array Yes A reference to a range of cells whose vertical height (number of rows) is counted. This is the officially documented argument type. No default documented

The official syntax is ROWS(array) with a single required argument and no optional parameters. Although the parameter is named array, the individual ONLYOFFICE help article describes a cell-range reference. It does not document an option to ignore blanks, hidden positions, filtered records or empty headers. Claims about non-contiguous ranges and array constants are deliberately withheld pending native validation (official function page).

Verified product scope, formula language and validation

The ONLYOFFICE Spreadsheet Editor function catalogue lists this name under Lookup and Reference Functions; its individual official article supplies the syntax below. Documentation access date: October 13, 2026. The English help pages are unversioned and do not establish a minimum ONLYOFFICE Desktop Editors build, a minimum ONLYOFFICE Docs server release, or identical results on every platform. The Formula tab help illustrates both online and desktop Spreadsheet Editors, but native formula execution was not performed on either. Platform support is therefore official-documentation-listed; runtime versions and platform parity remain unverified.

Examples use English function names and standard A1 references. The English Insert Functions instructions show a comma for separating multiple arguments. These particular functions take only one argument, so a separator is not required unless they are nested in another function such as IF. ONLYOFFICE’s Advanced Settings documents selectable formula language and regional settings; inspect your own interface if a localized formula cannot be pasted verbatim. A decimal/thousands display separator is not automatically proof of the formula argument separator.

Validation: source-documentation review plus independent counting of worksheet coordinates and expected arithmetic. All labelled results below are expected, never measured outputs. Native web run: not performed. Native desktop run: not performed. Imported XLSX behavior, named ranges, non-contiguous unions and edge-case errors were not tested.

Build a reproducible worksheet

Start a blank sheet and type the following values exactly into A1:D7; do not paste the backticks. Leave A5 genuinely blank (do not enter a space, an apostrophe or an empty-string formula). The sample table describes where each value goes and is not itself a claim of a tested spreadsheet file.

Cell Value to enter Purpose
A1 Order Identifier header
B1 Region Region header
C1 Units Numeric data header
D1 Status Status header
A2:D2 T101, West, 4, Ready First record
A3:D3 T102, East, 2, Hold Second record
A4:D4 T103, West, 6, Ready Third record
A5:D5 Leave A5 completely empty; enter West, 3, Hold in B5:D5 Deliberately blank identifier; this row is still inside the range
A6:D6 T105, North, 8, Ready Fifth record
A7:D7 T106, East, 1, Ready Sixth record

Type the following formulas into unused cells outside A1:D7 to avoid replacing the sample data.

Copy-ready formulas and independently calculated expected results

Formula Expected result Why
=ROWS(A2:A7) 6 Rows 2, 3, 4, 5, 6 and 7 are included.
=ROWS(B2:D7) 6 Width does not change the number of rows.
=ROWS(A5:A5) 1 A one-cell reference occupies one row, even when empty.
=ROWS(A2:D2) 1 One horizontal row is still one row.
=ROWS(B2:D4) 3 Inclusive endpoints 2 through 4.
=ROWS($A$2:A2) 1 Initial formula in E2, before fill-down.
=ROWS($A$2:A7) 6 Fixed beginning and row-7 ending.
=ROWS(A2:A7)-ROWS(A2:A4) 3 Six positions minus three positions.
=ROWS(A2:A7)=6 TRUE 6 equals 6.
=IF(ROWS(A2:A7)=6,"Six rows allocated","Check range") Six rows allocated The dimension check evaluates TRUE.
=COLUMNS(B2:D7)*ROWS(B2:D7) 18 Three columns times six rows.
=COUNTA(A2:A7) 5 The sample deliberately leaves A5 truly empty.

The “expected” column follows directly from the rectangular cell references, their inclusive endpoints, and the checked function definition. These outcomes were not observed in a running ONLYOFFICE editor. In the examples containing IF or another function, that companion function was separately checked against its official reference.

Advanced applications, with verification boundaries

1. Position numbering during a fill-down

In E2, enter =ROWS($A$2:A2) and fill down through E7. Expected: E2:E7 shows 1, 2, 3, 4, 5, 6, provided your editor copies the formula’s relative endpoint as usual. The $A$2 starting cell stays fixed; the ending reference moves from A2 to A7. This counts positions, not nonblank orders: the entry beside blank A5 is still 4. For a production tracker, do not confuse this with an immutable order ID; sorting rows changes their positions. Verify the copied formula addresses in your version.

2. Detect an unexpectedly short import

Use =IF(ROWS(A2:A7)=6,"Six rows allocated","Check import range"). Expected: Six rows allocated. This confirms that the reference spans six rows, not that all six rows contain valid records. For an actual completeness check combine a separate data-quality test. The official IF reference is the source for the branching function; output is independently derived from the range size.

3. Determine a rectangular area’s capacity

Use =ROWS(B2:D7)*COLUMNS(B2:D7); expected 18 cell positions (6 rows × 3 columns). An empty cell still occupies one of those positions. A result of 18 is not 18 filled values. The COLUMNS reference confirms the companion range-dimension function.

4. Contrast size with populated-cell count

The deliberately empty A5 makes =ROWS(A2:A7) expected 6, whereas =COUNTA(A2:A7) is expected 5, because there are five nonblank order IDs. These are different questions, not contradictory results. The COUNTA reference documents the latter’s purpose. Test any cell containing ="" separately: it is not the same as the truly empty A5 created in the sample.

Errors, limitations and troubleshooting

  1. Unexpected result of 6 when a record is missing. ROWS counts the height of the reference, not existing records. Inspect A5 and compare a documented count function such as COUNTA.
  2. An off-by-one count. A2:A7 contains 7 − 2 + 1 = 6 rows; endpoints are inclusive. A2:A6 contains only five.
  3. Text that looks like a reference. The argument is documented as a cell-range reference. Do not replace A2:A7 with the quoted text "A2:A7" and assume it will be interpreted as a reference. The precise error response remains native-test pending.
  4. Missing or malformed argument. The official syntax requires array. If you receive a parse or reference error, inspect the colon, sheet naming, delimiters, and selected source range first. This guide deliberately does not invent a specific error token for every invalid formula.
  5. Confusing ROW with ROWS. ROW(A7) is expected 7 (position); ROWS(A2:A7) is expected 6 (height). These functions answer different questions.
  6. Whole-column ranges and performance. A whole-column reference asks about a large range, not actual used rows. Avoid making performance or maximum-grid-size assumptions without checking your installed version.
  7. Filters and hidden rows. A geometric reference still includes row positions that may be hidden or filtered. Do not use ROWS as a visible-row counter; behavior of specific visibility-aware alternatives was not tested.
  8. Excel array-constant examples. Microsoft documents passing an array constant to ROWS. The checked ONLYOFFICE article only describes a range reference. Cross-product acceptance of {...} literals was not tested, so examples here use simple worksheet references only.

Excel cross-compatibility and other spreadsheet software

The independently checked Microsoft Excel ROWS article uses the same basic signature ROWS(array) and agrees on the dimension-counting purpose, so the simple A1-style range examples are meaningful to an Excel user as well. That is not a blanket compatibility guarantee: Excel’s documentation additionally discusses array constants and different releases. The ONLYOFFICE article supports the documented range-based use here; array-constant and import-parity tests in this document were not executed. No compatibility assertion is made for Google Sheets, LibreOffice Calc, mobile variants or every localized build.

Checked sources, access dates and validation log

  • ONLYOFFICE ROWS function — accessed 2026-10-13; source for purpose, signature, required range input, and the fact that the reference is a geometric dimension rather than an occupancy test.
  • ONLYOFFICE Insert Functions — accessed 2026-10-13; presence in the Lookup and Reference category, editor insertion workflow and English formula examples.
  • ONLYOFFICE Formula tab — accessed 2026-10-13; documents desktop and web editor interfaces; not a minimum-version proof.
  • ONLYOFFICE Advanced Settings — accessed 2026-10-13; provides formula-language and region settings context.
  • Microsoft ROWS function — accessed 2026-10-13; comparison only, not proof of ONLYOFFICE behavior outside the vendor specification.
  • ONLYOFFICE ROWS, COLUMNS, ROW, COLUMN, COUNTA, and IF — accessed 2026-10-13; supporting related concepts and cross-check formulas. Links were individually checked against the official help centre.

Verification: All coordinate calculations are independent expectations. Native Desktop/web scalar and array execution, localized parsing, historical versions and workbook interchange were not tested.