TOROW Function in LibreOffice Calc
Flatten a LibreOffice Calc range into one row with TOROW, comparing scan order, retained text and true-blank filtering in explicit examples.
Verification status: Eight ordinary INDEX-selected components, dimension or padding-check expressions were recalculated in LibreOfficeDev 26.8.0.0.alpha0 (2c87e51eeaa2b413ff4ae097b2705eea1995d8e5) using headless XLSX import and forced recalculation. Exact identities, typed results and controls were checked. LibreOffice 26.8.1.1 was source-reviewed only; stable 25.8 and GUI array entry were not executed. How formula examples are checked
Quick answer: =INDEX(TOROW(H2:J3);1;4) returned 4 in the tested development build.
Availability and version history
- Introduced: LibreOffice 25.8, explicitly stated in function-specific Help.
- Supported in: 26.8 Help and 26.8.1.1 registration; no retirement is established.
- Scope: Desktop Calc, English semicolon-separated formulas. Help identifies the
COM.MICROSOFT.TOROWnamespace outside OpenFormula 1.3. - Checked: October 14, 2026. Eight listed component/dimension examples were recalculated in LibreOfficeDev 26.8.0.0.alpha0 using headless XLSX import. Stable 25.8, 26.8.1.1 and GUI array entry were not executed.
What TOROW returns
TOROW converts a rectangle to one horizontal row. By default it reads the source across the first row, then across the next. Setting By_column to TRUE changes how values are read, while the returned result still remains a single row. Function Help.
Syntax and arguments
TOROW(Array [; Ignore [; By_column]])
Square brackets mark optional arguments; do not type them. Array is a range or matrix. Ignore is optional: 0 keeps every value, 1 ignores blank cells, 2 ignores error cells and 3 ignores both. By_column is optional and defaults to FALSE. Use the documented integer Ignore codes; the source checks that the converted value lies between 0 and 3.
For a whole-array result, the official Help instructs array-formula entry with Ctrl+Shift+Enter. The examples below instead select components with INDEX or inspect dimensions and padding. They do not establish a GUI spill or array-entry workflow.
Worksheet setup
Enter this source table in H2:J3:
| Row | H | I | J |
|---|---|---|---|
| 2 | 1 | 2 | 3 |
| 3 | 4 | 5 | 6 |
Also enter the mixed table below. Leave H9 and I10 truly empty; do not type the word “blank” or an empty-string formula.
| Row | H | I |
|---|---|---|
| 8 | red | 1 |
| 9 | (blank) | 2 |
| 10 | blue | (blank) |
Eight reproducible examples
The native column is from LibreOfficeDev 26.8.0.0.alpha0, build 2c87e51eeaa2b413ff4ae097b2705eea1995d8e5, using headless XLSX import and forced recalculation. Text is shown in quotes.
| Formula | Independent reference | LibreOfficeDev result |
|---|---|---|
=INDEX(TOROW(H2:J3);1;4) |
4 |
4 |
=INDEX(TOROW(H2:J3;0;TRUE());1;4) |
5 |
5 |
=ROWS(TOROW(H2:J3)) |
1 |
1 |
=COLUMNS(TOROW(H2:J3)) |
6 |
6 |
=INDEX(TOROW(H8:I10;1);1;3) |
2 |
2 |
=INDEX(TOROW(H8:I10;1;TRUE());1;2) |
"blue" |
"blue" |
=COLUMNS(TOROW(H8:I10;1)) |
4 |
4 |
=INDEX(TOROW(H8:I10;0);1;1) |
"red" |
"red" |
Practical worksheet
For H2:J3, =TOROW(H2:J3) gives 1, 2, 3, 4, 5, 6. The column-scanned =TOROW(H2:J3;0;TRUE()) gives 1, 4, 2, 5, 3, 6. This matters when flattening a grid of periods and categories: the same six numbers can represent a different sequence. The listed COLUMNS and ROWS checks verify that changing the scan order does not change the one-by-six output dimensions.
Advanced interpretation and checks
In H8:I10, leaving H9 and I10 truly empty and using Ignore=1 removes exactly two positions. Row scanning gives “red”, 1, 2, “blue”; column scanning gives “red”, “blue”, 1, 2. =INDEX(TOROW(H8:I10;1;TRUE());1;2) therefore returns “blue”. For a retained sequence of length k, TOROW has one row and k columns, whereas TOCOL arranges that same traversal vertically. Inspected implementation.
Boundaries and troubleshooting
Ignoring blanks is a type-sensitive operation. A zero, a space and a formula-generated empty string should not be casually treated as equivalent to a true blank. The native cases here use genuine empty cells and ordinary values. Error filtering and an entirely filtered result are source-only checks; the latter produces #N/A in the inspected callback. Large results can also exceed available worksheet space, which these small component examples do not test.
Related functions
Official evidence and checking scope
- Function-specific Help
- Complete versioned callback
- English native-name registration
- Complete shared implementation
- Typed value/empty-cell copy helper
All eight saved formula identities and their typed results were reconciled. The stale SUM cache changed to 3 and the uncached SUM returned 7. Imported _xlfn.TOROW formulas were saved with the documented COM.MICROSOFT.TOROW identity. These checks establish the listed development-build components only; current-source guards and unexecuted cases remain source-derived.