Forum Discussion
Flipping a table of 5 columns, 250 rows
- Sep 23, 2021
I think you were on the right track with this: I tried adding an ordered series 1 to 250 as a helper column but don't understand the large range of options in the sort drop down menu.
To illustrate the process, I created a small set of six rows, five columns, then added a helper column on the left.
Select (highlight) that full range (B3:G9)
Then on the Data toolbar I click on the Sort icon, seen here on the far right
And then in the Dialog box select my Column Z--the "helper column" as the Sort by column.
and set the Order to "Largest to Smallest"
and click OK
With this result:
I believe that Excel 365 is in the process of becoming a completely different programming environment from the traditional spreadsheet and offers very different methods. For example, given a range 'matrixA' with 'n' rows,
=INDEX(matrixA,SEQUENCE(n,1,n,-1),{1,2,3,4,5})
will generate a copy with the records in reverse order. Even further from the traditional semi-manual approaches of manipulating data within spreadsheets is
= LET(
n, ROWS(matrixA),
k, SEQUENCE(n,1,n,-1),
INDEX(matrixA,k,{1,2,3,4,5}))
which is the same formula but with additional locally scoped names defined within the formula.
Yet further from the traditional, it is possible to use a new function LAMBDA containing the formula above, which may be given a name such as 'REVERSEλ'. Using the name, the final formula reduces to
= REVERSEλ(matrixA)
Excel 365 is backward compatible, so it will also run spreadsheets!