How to sort with a formula (a live-sorted copy)
✓ Verified in LibreOffice 25.8.7.3 Google Sheets returned something else (2026-08-30)A sorted view that re-sorts itself when the data changes — leaderboards, top-lists, reports.
The formula
| App | Formula | Notes |
|---|---|---|
| Excel (desktop) | =SORT(A2:A100,1,-1) | Excel 365/2021. -1 = descending. SORTBY sorts by a different column than it returns. |
| Google Sheets | =SORT(A2:A100,1,FALSE) | Sheets’ SORT takes TRUE/FALSE for is_ascending where Excel and LibreOffice take 1/-1 — a real cross-app argument difference, and executed 2026-08-30 it bites silently: =SORT(A2:A4,1,-1) returned 10, 20, 50 in Google Sheets against 50, 20, 10 in LibreOffice. Sheets read the nonzero -1 as TRUE and sorted the other way with no error at all, so use FALSE for descending. Documented Sheets syntax, carrying no executed result of its own. |
| LibreOffice Calc | =SORT(A2:A100,1,-1) | Excel-style arguments; needs LibreOffice 24.8+. |
How it works
SORT spills a sorted copy while the source stays put — edit a value and the copy re-orders instantly, unlike menu sorting which is one-time and destructive. Mind the argument dialect: Excel and LibreOffice use 1/-1 for direction, Google Sheets uses TRUE/FALSE — one of the few places the same function has different signatures. Sort whole tables by widening the range (=SORT(A2:C100,3,-1) orders by the third column), and wrap FILTER output in SORT for filtered-and-ordered views.
The Google Sheets alternative
Google Sheets needs different syntax for this task. The formula below is Sheets-specific — it was executed in Google Sheets (2026-08-30) against the same sample data as the worked example, and the value beside it is what Google returned. The LibreOffice column reads n/a because the formula is outside LibreOffice’s dialect, so there is nothing of ours to report there.
| Formula | What it does | Returned by LibreOffice 25.8.7.3 | Returned by Google Sheets (executed 2026-08-30) |
|---|---|---|---|
=SORT(A2:A4,1,FALSE) | FALSE, not -1, for descending (the documented form, over this page's A2:A4 instead of A2:A100) | n/a (Sheets-only formula) | 50, 20, 10 Google Sheets alternative (executed 2026-08-30) NOTE: written with the PLAIN function name; the LibreOffice reference run executed the _xlfn. storage form of this formula, so the two runs are not byte-identical inputs |
Verified, not just documented
We ran =SORT(A2:A4,1,-1) in LibreOffice 25.8.7.3 (headless, with forced recalculation) and it returned 50, 20, 10 — exactly the expected result. We then ran the same formulas in Google Sheets, executed 2026-08-30: a formula-only workbook goes into Google Drive, which converts it to a Sheet and recalculates every formula with Google’s own engine, and comes back out as .xlsx carrying the values Google computed. For the worked example Google Sheets returned 10, 20, 50, which is not what LibreOffice returned (50, 20, 10) — both values are shown as each engine produced them, and the disagreement itself is the finding. A further 1 row is a Google Sheets alternative: Sheets-specific syntax, executed in Google Sheets only, so the LibreOffice column reads n/a for it. Both engines’ numbers on this page are executed results. The Excel formula follows Microsoft’s official documented syntax — we do not run desktop Excel.
Functions used
SORT — see full Excel, Google Sheets & LibreOffice compatibility for each.