← All how-to recipes

How to sort with a formula (a live-sorted copy)

✓ Verified in LibreOffice 25.8.7.3

A sorted view that re-sorts itself when the data changes — leaderboards, top-lists, reports.

The formula

AppFormulaNotes
Excel=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 ascending instead of 1/-1 — a real cross-app argument difference.
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.

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. Every formula here is confirmed by actually executing it.