Contact

WRAPCOLS in ONLYOFFICE Spreadsheet Editor

Lookup and Reference Intermediate ONLYOFFICE Spreadsheet Editor

Wrap a vector by columns with clear grouping, padding, fractional-count behavior and the inspected short-vector orientation exception.

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

Quick answer: With A1:A5 containing A through E, =WRAPCOLS(A1:A5,2,"-") has a source-derived 2 rows by 3 columns result, filled by columns and padded with one hyphen.

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 and direction

=WRAPCOLS(vector, wrap_count, [pad_with])

Two or three arguments are registered. The vector must be a single source row or column. wrap_count is the maximum number of source values to place in each output column, and the optional pad fills the last incomplete group. Default padding is the #N/A error, not a blank or a text label.

The source values are read in their existing vector order. WRAPCOLS fills each column before beginning the next. WRAPROWS fills in the other direction. The operation neither sorts the values nor changes their data types; the grouping is determined by position.

For a vector longer than wrap_count, use these ordinary dimensions: WRAPCOLS has wrap_count rows and enough columns to hold the vector; WRAPROWS has wrap_count columns and enough rows. However, the inspected implementation has an important early-return case when wrap_count is at least the input length: it returns the original vector unchanged, including orientation. That case is described below instead of assuming universal reshaping.

Step-by-step: wrap five labels in groups of two

  1. Enter text A, B, C, D and E in A1:A5, one label per cell.
  2. Keep an independent output area with room for 2 rows by 3 columns.
  3. Enter =WRAPCOLS(A1:A5,2,"-") using the array-formula entry method supported by your editor.
  4. The source-derived output is:
Output row Column 1 Column 2 Column 3
1 A C E
2 B D -

Five original labels occupy five positions and the hyphen fills the sixth. The order of original labels is preserved when you read the output down columns for WRAPCOLS or across rows for WRAPROWS. This provides an independent layout check: extracting the original values in that direction should reproduce A, B, C, D, E.

If pad_with is omitted, the last hyphen in the displayed grid is replaced by an internal not_available error, conventionally #N/A. An error pad may be useful for flagging missing positions, but it can propagate through later calculations. A text hyphen is a label; it is not numeric zero.

Advanced example: fixed-size display groups

This transformation is useful when a linear list needs a repeated display layout, such as labels grouped into pairs or a numeric series grouped into reporting blocks. Keep the original vector separate, because padded positions are newly created cells in the output array rather than new observations.

To prepare numeric groups for addition, use a zero pad only when “no contribution” is the intended meaning. Use a visible marker or default error if absence should stay obvious. An empty text string "" may look blank but remains text, and it should not be treated as proof that a cell has no value.

If the source is a two-dimensional table, flatten it deliberately before wrapping, using TOCOL or TOROW with the intended traversal order. Passing A1:B2 directly to WRAPCOLS is rejected in the inspected implementation because both dimensions exceed one. Choosing row-first versus column-first flattening can change which items appear together in the wrapped output.

The count-at-least-length exception

With the five-item column A1:A5, =WRAPCOLS(A1:A5,5,"-") is source-predicted to return that same 5-by-1 column, without padding or reorientation. A still larger count takes the same early return. For a five-item source row, the corresponding case returns the original 1-by-5 row.

This matters especially when the natural wrapping direction suggests a different output shape. Do not infer that wrap_count larger than the list always creates exactly that many rows or columns. If a fixed rectangular target is required even for short lists, an explicit expansion or another layout formula may be needed after checking the returned orientation.

Errors and fractional counts

The inspected code floors wrap_count before validation. For this dataset, =WRAPCOLS(A1:A5,2.9,"-") predicts the same output as count 2. A count that floors below 1 predicts internal not_numeric (#NUM!). Use positive whole counts so grouping is explicit and a decimal entry cannot silently change it.

An empty vector argument or a genuinely two-dimensional input predicts wrong_value_type (#VALUE!), returned within a one-cell array in the helper. Conversion errors in the count propagate. The pad is allowed to be an error value; unlike the required inputs, it is not rejected just because it is an error. If a range or array is provided as the pad, the inspected helper selects its upper-left element. Prefer a scalar pad for portability.

Blanks inside a valid vector are values in the traversal, not a request to compress the list. If you need to remove them, do that intentionally beforehand and consider whether shifting positions will change the grouping. Native display of blank elements, spill behavior, resource limits for very large vectors and exact application error rendering are outside the source-only examples.

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