In Calc, how do I invert order in a column?

Example: Data entered new to old would like to display old to new.

You may create an auxiliary column, put there numbers from 1 to N, and use that column for sorting.

Afaik there is no standard tool for this kind of flipping.
You may use the code provided in the attached example.
No guarantee of any kind!
rerarrangingArraysCodeAndExamples.ods (19.6 KB)

BTW: Newest on top should be better in most cases.

== Editing ==
Replace the SUBRANGE() UDF from the example with the following one-liner:

Function subrange(pArray, pOffR As Long, pOffC As Long, pCountR As Long, pCountC As Long)
REM V0.2 2025-06-06 by Lupp, aka Jaeger Wolfgang
Redim Preserve  pArray(1 + pOffR To pOffR + pCountR, 1 + pOffC To pOffC + pCountC)
subrange = pArray
End Function

Attachment didn’t come through…

Thanks!
Added the upload.

Thanks for the suggestions. Never knew there was a FLIP function. I’ll play around with that.

The functions used in the example aren’t standard functions but UDFs.

Hallo
since LO24.8:

=INDEX(your_data;SEQUENCE(ROWS(your_data);;ROWS(your_data);-1))
or
=SORTBY( your_data ; ROW(your_data) ; -1 )
1 Like

The “old-fashioned” array formula?
â €
=INDEX(your_data;ROWS(your_data)-ROW(your_data)+1)