Contact

WRAPCOLS Function in LibreOffice Calc

Array LibreOffice Calc LibreOffice 25.8

Arrange a LibreOffice Calc vector down columns with WRAPCOLS; calculate dimensions and distinguish numeric, text and default #N/A padding.

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(WRAPCOLS(H6:K6;2);1;2) 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.WRAPCOLS namespace 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 WRAPCOLS returns

WRAPCOLS reshapes a single row or column into a rectangular array, filling each output column downward before moving right. Wrap_count specifies the number of positions in each output column. It preserves sequence order while changing the layout. Function Help.

Syntax and arguments

WRAPCOLS(Range; Wrap_count [; Pad_with])

Square brackets mark optional arguments; do not type them. Range must be one-dimensional: a single row or a single column. Wrap_count should be a positive integer. Pad_with is optional and can be numeric or text; omitted padding uses #N/A. For N source values and count k, the output has k rows and ceil(N/k) columns, including the final padded positions.

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(WRAPCOLS(H6:K6;2);1;2) 9 9
=INDEX(WRAPCOLS(H6:K6;2);2;1) 8 8
=ROWS(WRAPCOLS(H6:K6;3;0)) 3 3
=COLUMNS(WRAPCOLS(H6:K6;3;0)) 2 2
=INDEX(WRAPCOLS(H6:K6;3;"pad");2;2) "pad" "pad"
=ISNA(INDEX(WRAPCOLS(H6:K6;3);3;2)) TRUE TRUE
=INDEX(WRAPCOLS(L2:L4;2;0);1;2) 50 50
=INDEX(WRAPCOLS(H6:K6;1);1;4) 10 10

Practical worksheet

Enter 7, 8, 9, 10 across H6:K6. =WRAPCOLS(H6:K6;2) produces a two-by-two result with rows 7, 9 and 8, 10. The first output column consumes 7, 8 before the second consumes 9, 10. This ordering can be useful for arranging a linear list into vertical groups, but it differs from WRAPROWS and should be checked before assigning labels to the resulting columns.

Advanced interpretation and checks

Using count 3 with four inputs produces three rows and two columns: the first column is 7, 8, 9, and the next is 10 followed by two padding positions. The number of pads is k×ceil(N/k)−N, here 2. The table checks both a text pad and default #N/A. A vertical input such as L2:L4 follows its top-to-bottom order; it is not required to start as a horizontal row. Inspected implementation.

Boundaries and troubleshooting

A genuinely two-dimensional input is rejected by the inspected implementation. Flatten it deliberately first if the intended traversal is known. Zero count is invalid, and negative, fractional or extreme counts were not executed; use small positive integers rather than relying on conversion details. Padding does not mean a source record existed at that position. Empty text, numeric zero and default #N/A carry different meanings in later calculations.

Official evidence and checking scope

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.WRAPCOLS formulas were saved with the documented COM.MICROSOFT.WRAPCOLS identity. These checks establish the listed development-build components only; current-source guards and unexecuted cases remain source-derived.