WRAPROWS Function in LibreOffice Calc
Arrange LibreOffice Calc values across rows with WRAPROWS, including final-row padding, vertical inputs and exact component checks.
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(WRAPROWS(H6:K6;2);2;1) returned 9 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.WRAPROWSnamespace 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 WRAPROWS returns
WRAPROWS reshapes one row or one column into a rectangle, filling each output row from left to right before moving downward. Wrap_count is the number of positions in each row. The input order remains intact; the function neither sorts nor groups values by content. Function Help.
Syntax and arguments
WRAPROWS(Range; Wrap_count [; Pad_with])
Square brackets mark optional arguments; do not type them. Range is a one-dimensional range or array. Wrap_count should be a positive integer. Pad_with optionally supplies numeric or text padding; without it, unused positions in the final row are #N/A. For N entries and width k, the output has ceil(N/k) rows and k columns.
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 7, 8, 9, 10 across H6:K6. For the vertical-input example, enter 10, 30, 50 down L2:L4.
Eight reproducible examples
The native column is from LibreOfficeDev 26.8.0.0.alpha0, build 2c87e51eeaa2b413ff4ae097b2705eea1995d8e5, using headless XLSX import and forced recalculation. TRUE is a Boolean result from the padding check, not an error value. Text is shown in quotes.
| Formula | Independent reference | LibreOfficeDev result |
|---|---|---|
=INDEX(WRAPROWS(H6:K6;2);2;1) |
9 |
9 |
=INDEX(WRAPROWS(H6:K6;2);1;2) |
8 |
8 |
=ROWS(WRAPROWS(H6:K6;3;0)) |
2 |
2 |
=COLUMNS(WRAPROWS(H6:K6;3;0)) |
3 |
3 |
=INDEX(WRAPROWS(H6:K6;3;"pad");2;2) |
"pad" |
"pad" |
=ISNA(INDEX(WRAPROWS(H6:K6;3);2;3)) |
TRUE |
TRUE |
=INDEX(WRAPROWS(L2:L4;2;0);2;1) |
50 |
50 |
=INDEX(WRAPROWS(H6:K6;1);4;1) |
10 |
10 |
Practical worksheet
For H6:K6 containing 7, 8, 9, 10, =WRAPROWS(H6:K6;2) gives rows 7, 8 and 9, 10. The second row’s first value is 9, as checked with INDEX. Compare WRAPCOLS with the same count: it fills down the first column before moving right. Selecting the wrong orientation can produce a plausible-looking table whose row groups are wrong.
Advanced interpretation and checks
Count 3 makes a two-by-three rectangle: 7, 8, 9 in the first row, then 10 and two pads in the second. The output has k×ceil(N/k) total positions, so the pad count is that total minus N. Numeric zero is convenient for a genuine zero-fill model; a text marker is better for visibly incomplete groups. With count 1, every input occupies its own row, including the fourth value 10. Inspected implementation.
Boundaries and troubleshooting
The source requires a single row or single column, so a two-dimensional rectangle needs an explicit flattening order first. Use positive integer counts and avoid assuming a negative or fractional count has useful semantics. Default #N/A is a missing-position marker; it should not be silently changed to zero if that changes the meaning of the data. The ordinary component tests do not establish GUI array-entry or worksheet-size limits.
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.WRAPROWS formulas were saved with the documented COM.MICROSOFT.WRAPROWS identity. These checks establish the listed development-build components only; current-source guards and unexecuted cases remain source-derived.