Collabora Office CHOOSECOLS: Select, repeat and reorder columns
Select columns by position in the new Linux desktop source build, use negative indices and understand output shape and selector limits.
Verification status: See the evidence and test scope described in this guide. How formula examples are checked
Quick answer: =CHOOSECOLS(A1:C4;3;1) selects the third column and then the first. It preserves all four rows and produces a 4-row × 2-column array. It selects by position, not by header text or a matching condition.
Syntax and positional rules
=CHOOSECOLS(Array; Column_1 [; Column_2 ...])
Array is the source range or array. At least one column selector is required. Positions start at 1 on the left; −1 means the last column, −2 the next-to-last. Repeated selectors repeat columns, and selector order determines output order. Official CHOOSECOLS help.
Use integer selectors. The inspected evaluator converts numerical selectors to 32-bit integers, with approximate truncation toward zero, but relying on fractional indices makes an already positional formula harder to audit. There is no default meaning for an omitted selector: the implementation rejects an empty selector argument. Keep the semicolon separators shown here unless your configured formula syntax uses another separator.
Worked example: export units before item names
Enter this complete source grid in A1:C4:
| Row | A | B | C |
|---|---|---|---|
| 1 | Item | Region | Units |
| 2 | Pen | East | 12 |
| 3 | Pad | West | 8 |
| 4 | Clip | East | 15 |
- Keep the header row inside the source range.
- Use
=CHOOSECOLS(A1:C4;3;1)in a separate output area. - The independently derived array is:
| First output column | Second output column |
|---|---|
| Units | Item |
| 12 | Pen |
| 8 | Pad |
| 15 | Clip |
The calculation is direct coordinate selection: each output row contains source column C followed by source column A. Text headers are copied just like data. No sort or aggregation occurs, and the source is not rearranged in place.
=CHOOSECOLS(A1:C4;-1;1) gives the same expected grid because the source has three columns. In contrast, selector −1 always follows the current right edge if the referenced range later expands; selector 3 always identifies the third position. Choose according to whether your intended rule is “last field” or “field at position three.”
Advanced use: duplicate a field in an export layout
Suppose a downstream layout needs Region twice, once for display and once for a separate grouping field. =CHOOSECOLS(A1:C4;2;2) independently gives:
| Output 1 | Output 2 |
|---|---|
| Region | Region |
| East | East |
| West | West |
| East | East |
The output has two columns even though only one distinct source column was requested. Duplicate columns are deliberate, not duplicate-row removal. =CHOOSECOLS(A1:C4;1) instead retains one column and all four rows. To change rows as well, use the separately documented CHOOSEROWS operation; verify each intermediate shape before nesting formulas.
For a maintainable report, keep a written mapping from selector numbers to headers. Inserting a column inside a referenced range can change which field occupies a numbered position. CHOOSECOLS does not perform header-name lookup.
Errors, blanks and implementation limits
- Selector 0 is invalid. A selector outside the three-column range, such as 5 or −4, also fails. The inspected branch returns internal
IllegalParameter; its localized UI presentation has not been tested here. - An empty selector position is rejected, rather than silently choosing all columns.
- A selected genuine blank is copied as an empty matrix cell. That internal state does not prove whether a particular output UI displays a blank or zero.
- The evaluator accepts selector matrices and traverses them column by column. Its text/empty selector check uses the matrix dimensions rather than the current element coordinates. Scalar and multi-cell text selectors can therefore follow different checks. Use explicit numeric integer selectors; do not depend on coercing mixed text/blank selector arrays.
- Selection preserves source values, not a separately verified copy of cell formatting, widths, validation rules or comments.
These distinctions come from ScChooseColsOrRows and its copy helper. They bound the examples to predictable numeric selection rather than promising every cross-product edge case.
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.CHOOSECOLS. 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.
Related functions
- CHOOSEROWS: select rows with the corresponding positional contract
- DROP: remove an edge instead of listing selected columns