Contact

TOROW in ONLYOFFICE Spreadsheet Editor

Lookup and Reference Intermediate ONLYOFFICE Spreadsheet Editor

Flatten an array into one row with explicit scan order, blank and error filters, reproducible grids and honest array-entry limitations.

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

Quick answer: For source rows 1,2,3 and 4,5,6, =TOROW(A1:C2) produces the source-derived row sequence 1,2,3,4,5,6. TRUE as the third argument changes the sequence to 1,4,2,5,3,6.

Availability and evidence scope

  • Introduced: Original introduction release is not established by the checked sources.
  • Available: Listed in current unversioned ONLYOFFICE help, checked October 18, 2026.
  • Implementation inspected: Official SDKJS v10.0.0.169, commit 3679e0375a758d7dc59d31337a45461be3525ed8. The snapshot does not prove identical behavior in every installed editor.
  • Retired or deprecated: These sources do not establish retirement or formal deprecation.
  • Testing: Numerical examples are independent mathematical expectations, and implementation discrepancies are labeled source predictions. No ONLYOFFICE application or calculation-engine execution was performed.

The examples use English function names and commas. Use your locale’s argument separator if different. Retain full precision in formulas; round only the displayed result. Nested output grids describe source-derived array contents. Native spill placement, obstruction errors, array-entry shortcuts and recalculation behavior have not been tested in the application. Reserve a separate output area and follow the array-formula entry method supported by your installed editor; do not assume a particular keyboard shortcut or automatic spill behavior.

Syntax, defaults and output direction

=TOROW(array, [ignore], [scan_by_column])

One to three arguments are registered. The result is a single row. The optional scan flag controls how the source is read, not the orientation of the result. FALSE or omission reads across each source row before moving down; TRUE reads down each source column before moving right. TOCOL uses the other output orientation, but the same source-reading distinction.

Ignore code Meaning
0 or omitted Keep all source values
1 Omit genuinely empty elements
2 Omit error elements
3 Omit both empty and error elements

Ignoring values compacts the output. It does not leave placeholder positions behind. Zero and ordinary text are retained. A formula returning "" produces a string rather than an empty element and is not automatically removed by the blank-only rule in this inspected helper.

Step-by-step: prove the scan order

  1. Enter 1, 2 and 3 in A1:C1.
  2. Enter 4, 5 and 6 in A2:C2.
  3. On a separate output area evaluate =TOROW(A1:C2,0,FALSE).
  4. The source-derived result has 1 row by 6 columns, with values in this sequence: 1, 2, 3, 4, 5, 6.
  5. Evaluate =TOROW(A1:C2,0,TRUE) separately. Its orientation is still a row, but its sequence becomes 1, 4, 2, 5, 3, 6.

These sequences are independently constructed by traversing the two-by-three input grid. Row-first order visits A1, B1, C1, A2, B2, C2; column-first order visits A1, A2, B1, B2, C1, C2. No sorting is performed. If the source contains duplicate values, the duplicates remain in their traversal positions.

Do not place the result over its source. The guide describes array contents and dimensions; it does not assert that a particular installed edition automatically spills into the indicated cells or uses a particular array-entry shortcut.

Advanced example: remove blanks and errors deliberately

On a fresh sheet, build this two-row grid:

Source row A B C
1 1 Leave genuinely empty =1/0
2 0 Text x 2

Use =TOROW(A1:C2,3,FALSE). The source-derived remaining sequence is 1, 0, x, 2, arranged as one row. The blank and division error are removed; the numeric zero and text x remain. The length is four rather than six.

With ignore code 1, only the blank is removed, leaving sequence 1, #DIV/0!, 0, x, 2. With ignore code 2, the error is removed but the blank element remains. The inspected code preserves an empty object for that element; its on-screen rendering, including whether an editor shows zero, is not verified here.

This can prepare a linear list for another formula, but suppressing errors changes the dataset. If an error represents a missing record or broken calculation, silently discarding it may hide a problem. Keep an error count or inspect the source first. If multiple related fields must stay aligned, do not flatten each field with different ignore rules; the retained positions may no longer correspond.

Validation, limits and compatibility details

Use only documented integer ignore codes 0–3. The inspected switch has no rejecting default and does not round the ignore value, so an unsupported code such as 4 falls through and keeps all elements. A fractional code also does not match the documented integer cases. These are source observations, not recommended options.

The helper rejects an input whose logical element count exceeds 1,048,578 with internal not_numeric, conventionally #NUM!. It checks source size before filtering, so requesting blank removal does not turn an oversized source into a supported one. This source limit is separate from worksheet placement limits and should not be used as a target for a large interactive calculation.

Conversion errors in options propagate. Use genuine Boolean scan flags and numeric ignore codes. If all elements are filtered out, the helper constructs an empty array; this guide does not claim an exact application error or visible empty-result shape for that case. Multi-sheet and unusual scalar/coercion cases likewise need separate verification.

Flattening is different from transposing: TRANSPOSE swaps grid axes while preserving a rectangular arrangement, whereas TOROW produces one linear sequence. Choose the operation based on whether relationships are encoded by row/column position or by the sequence itself.

Recalculate representative formulas when moving a workbook between editors. Matching names do not guarantee identical argument coercion, array behavior, numerical precision or error handling. These source-derived examples do not establish automatic spill behavior or a general import/export guarantee.

Official references