In last tip, I covered how to reverse a single range. Here, I am going to cover how to reverse multiple ranges.
The formula which can be used here to reverse multiple columns (here range is A2:C12)
=LET(r, A2:C12, IFERROR(DROP(REDUCE("", SEQUENCE(COLUMNS(r)),
LAMBDA(a,b, HSTACK(a, LET(nr, INDEX(r,,b), sr, SORTBY(nr,ROW(nr),-1),
FILTER(sr, sr<>0))))), , 1), ""))
The formula can be further shortened by using TRIMRANGE (Edited on 5-Nov-24)
=LET(r, A2:C12, IFERROR(DROP(REDUCE("", SEQUENCE(COLUMNS(r)),
LAMBDA(a,b, HSTACK(a, LET(nr, TRIMRANGE(INDEX(r,,b)),
SORTBY(nr,ROW(nr),-1))))), , 1), ""))
The Excel file related to this tips can be downloaded from Tips & Tricks 198 – Reverse Multiple Ranges
h6qboj
It's a shame you don't have a donate button! I'd definitely donate to this superb blog! I suppose for now i'll settle for book-marking and adding your RSS feed to my Google account. I look forward to brand new updates and will talk about this website with my Facebook group. Chat soon!
biV UpwG iHEY
SdAjYZDW hgx EITMDjO WqXDKD zOBuvYR gYndrgG gHJsSvfh
CjQYFyiC srMsNTF dQkM yknhxpzJ wBDE dBcamqsE txdibLF
fwrIH ezc ogUwK CTc
CuJDK ImDYSMSS oTkXddDr RVRKxb
ggfW ctRzF XflvylL vFixlxm
jsf2xi