Collabora Office SORT: Row and Column Ordering
Sort complete numeric records or columns by a selected key, with explicit defaults, direction and source-checked invalid arguments. Scoped to the new Linux desktop source build.
Verification status: See the evidence and test scope described in this guide. How formula examples are checked
SORT returns the contents of a range or array in a new order. In the usual row mode it moves complete rows according to a key column, preserving the other values in each record. Column mode instead moves complete columns using a key row.
Syntax and defaults
=SORT(Range [; SortIndex [; SortOrder [; ByCol]]])
The source defaults SortIndex to the first column or row, SortOrder to 1 for ascending and ByCol to FALSE for sorting rows. Set SortOrder to -1 for descending. Set ByCol to TRUE to sort columns instead.
SortIndex is one-based relative to the supplied range, not an absolute sheet column number. In row mode it chooses a column inside that range; in column mode it chooses a row. The examples use a single integer key and distinct numeric values to avoid unverified text collation and tie-order assumptions.
Step by step: sort complete records
Enter this header-free range A2:B4:
| Row | A: ID | B: Amount |
|---|---|---|
| 2 | 30 | 300 |
| 3 | 10 | 100 |
| 4 | 20 | 200 |
For =SORT(A2:B4), the independent expected 3×2 result is:
10 100
20 200
30 300
The defaults sort by the first column ascending. =SORT(A2:B4;1;1;FALSE) expresses those same choices explicitly. The amount stays attached to its original ID; independently sorting just the amount column would be a different operation.
For =SORT(A2:B4;2;-1), the second column is the key and descending order produces [30,300], [20,200], [10,100]. In a larger table, exclude a header row from the input unless it genuinely belongs among the records. SORT has no header-preservation argument in this signature.
Sort columns using a key row
Enter D2:F3 as:
30 10 20
300 100 200
=SORT(D2:F3;1;1;TRUE) sorts columns by the first row and returns:
10 20 30
100 200 300
=SORT(D2:F3;2;-1;TRUE) uses the second row descending and returns [30,20,10] over [300,200,100]. Each vertical pair remains intact. Setting ByCol changes which dimension the index addresses; it does not merely reverse the sort order.
These are source-derived matrix expectations. The guide does not claim that either formula was entered through the new desktop’s array interface.
Advanced: preserve the meaning of a record
Suppose the numeric ID identifies an order and the amount is its total. Sorting a 3×2 record block preserves that association. Sorting the two columns separately could silently pair an ID with the wrong amount, even though every original number still appears somewhere.
If the required key is outside the selected output range, this function’s index is not an external lookup reference. Restructure the input deliberately or review a function designed for separate key arrays. Do not treat a sheet column number such as 4 as the fourth key when the selected range has only two columns.
Numeric-looking text is a different data type from numbers. The vendor help demonstrates mixed values, but those examples do not establish every locale’s text ordering or stable order for equal keys. Normalize inputs deliberately and add an explicit secondary-key design where necessary instead of assuming a tie will always preserve input order. This guide does not certify the source’s multi-key array extensions.
Source-checked invalid arguments
The evaluator requires each sort-order value to be exactly 1 or -1. =SORT(A2:B4;1;0) reaches internal IllegalParameter; zero does not mean “leave unchanged.” An index below 1 is also rejected, so =SORT(A2:B4;0;1) is invalid in the source trace.
With A2:B4, index 3 exceeds the two-column row-sort width and is rejected. By contrast, a one-row input in row mode has no rows to reorder; the source can return it unchanged. These statements describe evaluator branches, not native error-display observations.
Array workflow and compatibility
The help describes an array formula. The checked evaluator creates or returns a sorted result without establishing the new Qt application’s spill, overwrite or resizing behavior. No Ctrl+Shift+Enter or other UI sequence was executed here, and an output matrix in this guide is a mathematical layout rather than a screenshot.
Check input shape, index orientation, numeric types and order before interpreting a result. The function is distinct from an interactive in-place Data Sort command: a formula’s result does not itself demonstrate that source cells were rearranged.
Product scope, version and evidence
This guide concerns the new Collabora Office desktop for Linux, mapped by its Flathub manifest to source build coda-26.04.4.3-1, commit 81339d176148d0d5c81ff05d82540f58f8aaa117. It uses Collabora Office 26.04 SORT help and the exact evaluator source, checked October 18, 2026. The vendor’s desktop release announcement and the Linux package manifest provide product context; the latter is a mutable publication, not an installed-binary attestation.
Examples are independent calculations and source traces. No Collabora runtime or calculation engine was executed, and no native screenshot or array-entry workflow is claimed. This narrow evidence does not certify Classic, Online, CODE, mobile, Windows or macOS behavior. The original Collabora introduction release is unknown; upstream release history is not substituted for it.
The help identifies COM.MICROSOFT.SORT and states that the function is outside OpenFormula 1.3. This is a format-compatibility caution, not a deprecation or retirement notice. File export, import and recalculation in another product were not tested.