SORT Function (Gnumeric)
Sort Gnumeric numeric values into a vertical list, with descending default order, ignored types, duplicate retention and safe order controls.
Verification status: See the evidence and test scope described in this guide. How formula examples are checked
Quick answer: Gnumeric SORT returns a vertical numeric list. Its default order is descending; specify 1 for ascending. It does not implement a modern whole-record SORT signature with a sort-column argument.
Availability and evidence
- Introduction: Gnumeric 1.10.8. NEWS explicitly adds SORT and ARRAY.
- Source support: Registered in the Gnumeric 1.12.62 plugin. No retirement is established. The last functioning application version is unverified for this guide.
- Evidence dates: Official source was retained October 13–14, 2026 and reviewed October 15. Typed-list, positional, workbook-index and exact product checks are independent reference calculations. No native Gnumeric, compiled-library, headless application or GUI execution was performed.
Exact syntax and order controls
=SORT(ref[,order])
Ref supplies the numbers to be sorted. Order is optional: 0 means descending, 1 means ascending, and the default is 0. The pinned help describes a list of numbers, and the plugin marks its implementation status as a subset. Do not import a different product’s argument order or record-sorting features.
The collector ignores strings, Boolean values and physically empty cells, retaining numeric zero and repeated numbers. An error in the collected input propagates. The result has one column; it does not preserve the original rectangular shape or attached labels.
Use the explicit integer controls 0 and 1 in ordinary work. The source converts an order number to an integer before switching on those two accepted values. Other resulting integers produce #VALUE!. The reference table includes ordinary fractional controls to make that implementation boundary visible without making a locale-coercion claim.
Complete numeric worksheet
Create SortControls. Enter numbers 4,3,5,3,0,-2 in A2:A7. Enter text 9 in text-formatted A8, Boolean TRUE in A9, and leave A10 physically empty.
Select C2:C7 and enter =SORT(A2:A10) using the documented Ctrl+Shift+Enter array procedure. The independent reference list is:
| Output row | Descending C | Ascending E |
|---|---|---|
| 2 | 5 | -2 |
| 3 | 4 | 0 |
| 4 | 3 | 3 |
| 5 | 3 | 3 |
| 6 | 0 | 4 |
| 7 | -2 | 5 |
For the ascending column, separately select E2:E7 and enter =SORT(A2:A10,1). Six numeric values produce six output entries even though the source range has nine cells. Text 9 does not become the largest numeric value, and TRUE does not become 1.
In a copy change A2 from 4 to 6. The descending result becomes 6,5,3,3,0,-2 and the ascending result becomes -2,0,3,3,5,6. Keep the original and changed cases separate.
Reference controls
| Formula or controlled values | Independent reference result |
|---|---|
=SORT(A2:A10) |
[5; 4; 3; 3; 0; -2] |
=SORT(A2:A10,0) |
[5; 4; 3; 3; 0; -2] |
=SORT(A2:A10,1) |
[-2; 0; 3; 3; 4; 5] |
=SORT(A2:A10,2) |
#VALUE! |
=SORT(A2:A10,-1) |
#VALUE! |
=SORT(A2:A10,0.9) |
[5; 4; 3; 3; 0; -2] |
=SORT(A2:A10,1.9) |
[-2; 0; 3; 3; 4; 5] |
Numeric [4,1,3], ascending |
[1; 3; 4] |
Input includes error |
#NUM! |
Lists describe the returned values, not localized literal punctuation. The counts and orderings are independently recomputed from the stated types. They are not native worksheet captures.
Advanced: duplicates and ranks are different questions
The two numeric 3 values remain two entries. SORT orders observations; it does not deduplicate them, return their occurrence counts or attach rank numbers. If a report needs unique values, frequencies or rank statistics, specify that separate transformation rather than assuming it happened during sorting.
For the original numeric data, the ascending minimum and maximum are -2 and 5, and the sum remains 13 in either order. These invariants help detect accidentally excluded cells or changed values. Sorting changes positions, not the multiset of collected numeric values.
Applying ascending SORT twice has the same reference result as once. Applying descending SORT to the ascending result returns the original descending list. These checks use numeric-only constructed arrays, so the collector does not drop any further entries.
Advanced: protect record associations
Suppose labels Alpha, Beta and Gamma correspond to numeric values 4,1,3. Sorting only the numeric values ascending gives 1,3,4. Leaving labels in their original order would incorrectly pair Alpha with 1 instead of 4.
This function’s two-argument numeric-list interface does not automatically carry companion columns. Use a separately verified record-sorting workflow when complete rows must move together. The presence of a rectangular input range does not turn this function into a multi-key table sorter.
Advanced: distinguish omitted from invalid order
The source default is zero, so leaving order out requests descending order. Explicit order 1 requests ascending; order 2 or -1 yields #VALUE!. For ordinary numeric order 0.9, the integer conversion gives 0, while 1.9 gives 1. These are source-derived controls, not a recommendation to use fractional settings.
Do not rely on conversion of arbitrary text, extremely large values or numbers just next to an integer boundary. Keep 0 or 1 in a parameter cell and make its purpose visible beside the formula.
Errors, empty input and display limits
An input error is propagated during collection even if the surrounding values would otherwise sort normally. Numeric-looking text is ignored instead of generating a type error. A matching displayed value is not enough to establish a numeric cell’s stored type.
If no numeric values remain, the source takes a zero-length array-construction path. Its native display, padding or final worksheet error was not established here; do not promise a visible empty list, a scalar zero or a specific error for that case. Check the numeric count before using a dynamic imported range in a workflow that requires at least one observation.
The main examples all contain numeric observations. Native array rendering, spill resizing, locale-dependent parsing and workbook transfer remain unverified. Select the complete expected output and use the documented array-entry procedure rather than treating a clipped view as a different numerical result.