Contact

Collabora Office EXPAND: Pad an array to a target size

Lookup and Reference Intermediate Collabora Office Calc

Set final array dimensions and numeric or text padding in the new Linux desktop source build, with smaller-size and blank-cell cautions.

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

Quick answer: =EXPAND(A1:B2;3;4;0) places the original 2 × 2 array in the top-left of a 3-row × 4-column result and fills the eight new positions with zero. Rows and Columns specify the final dimensions, not how many rows or columns to add.

Syntax and defaults

=EXPAND(Array; Rows [; Columns [; Pad_with]])

Rows sets the result height; Columns sets its width. An omitted Columns retains the source width. A missing Rows position retains the source height in the inspected evaluator, so =EXPAND(A1:B2;;3;0) expands only the width. The Rows position still needs its separator placeholder when later arguments are present. Official EXPAND help.

Pad_with can be a number or text. If omitted, added cells receive the not-available error that the help describes as #N/A. An explicit zero is real numerical data; it is not the same as an error marker or empty cell.

Use positive whole-number target dimensions at least as large as the original. The source performs integer conversion before comparing sizes. Negative dimensions are not a supported sizing technique: the implementation compares their absolute values but later assigns signed values into unsigned dimensions. No safe negative-size behavior or resulting UI error is asserted here.

Worked example: align a short block with a report template

Enter:

Row A B
1 1 2
2 3 4

For =EXPAND(A1:B2;3;4;0), the complete independently derived array is:

Output 1 Output 2 Output 3 Output 4
1 2 0 0
3 4 0 0
0 0 0 0

The source has four cells and the target has twelve, so exactly eight cells are added. Original coordinates do not move: source B2 remains the result’s second-row, second-column value 4. Padding is added to the right and below, never above or to the left.

=EXPAND(A1:B2;2) keeps the original 2 × 2 dimensions. =EXPAND(A1:B2;;3;0) gives rows [1,2,0] and [3,4,0]. These examples separate an omitted dimension from a supplied zero dimension, which is too small for this source.

Advanced use: choose a meaningful missing-data marker

For a status report, =EXPAND(A1:B2;3;3;"pending") independently gives:

Output 1 Output 2 Output 3
1 2 pending
3 4 pending
pending pending pending

A text marker can make new positions visible without presenting them as observed zeros. However, it creates a mixed-type array; later calculations need an explicit policy for text. A zero pad can change a subsequent average by adding numerical observations. An error pad can deliberately prevent a downstream calculation from silently treating missing data as complete.

With =EXPAND(A1:B2;3), the expected third row consists of two not-available errors. The first two rows remain unchanged. Choose the padding policy according to what the new cells mean, rather than merely what looks cleanest in a report.

Errors and limits

  • =EXPAND(A1:B2;1;2;0) requests fewer rows than the source and follows internal IllegalArgument. EXPAND is not a cropping function; use a selection or edge-removal function for that job.
  • Padding applies only outside the source rectangle. A genuine blank already inside A1:B2 is copied as an empty matrix cell, not replaced by Pad_with.
  • An excessively large target may fail allocation. This guide does not promise a maximum safe grid size or test resource limits.
  • The expected array is a value result, not a verified copy of number formats, column widths or comments.
  • Output placement, automatic spill, keyboard entry and UI error localization have not been tested in this new desktop application.

The size checks, defaults, copy loop and error padding are visible in the pinned ScExpand implementation. The negative-dimension caution follows its actual checks rather than assuming another product’s error contract.

Product scope, compatibility and evidence

This guide covers the new Collabora Office desktop for Linux, using the Flathub source tag coda-26.04.4.3-1 and commit 81339d176148d0d5c81ff05d82540f58f8aaa117. The official desktop release notes and Linux package manifest identify that product/build. The package manifest is a dated observation from October 18, 2026, rather than an installed-binary check.

The 26.04 function help and exact evaluator source were inspected on October 18, 2026. Expected examples were independently calculated; no Collabora application was run. Output grids describe evaluator results, not a verified spill or keyboard-entry workflow. Classic, Online/CODE, other operating systems and file-format round trips require their own checks.

The help identifies this function as outside OpenDocument 1.3 and uses the extension name COM.MICROSOFT.EXPAND. That does not establish lossless export to every spreadsheet format. The first Collabora release introducing it is not established by these sources. It is documented here as available, with no cited retirement or deprecation notice; an undocumented introduction date is not a deprecation claim.

  • DROP: remove edge rows or columns
  • CHOOSECOLS: select columns before building a padded layout