Reputation: 509
Need to reverse and transpose a row in google sheet
like below
Tried below formula but didn't reversed the order. Help me out!
=FILTER(TRANSPOSE(A1:E1),TRANSPOSE(A1:E1)<>"")
Upvotes: 1
Views: 3034
Reputation: 50697
=SORT(TRANSPOSE(A1:E1),SEQUENCE(COLUMNS(A1:E1)),)
SEQUENCE
to create a array of sequential numbersSORT
to sort them in reverseIf you need to check for blanks, use QUERY
to filter:
=QUERY(SORT(TRANSPOSE(A1:E1),SEQUENCE(COLUMNS(A1:E1)),),"where Col1 is not null",0)
Upvotes: 2
Reputation: 15328
Try
=query(sort(transpose({ARRAYFORMULA(column(A1:E1));A1:E1}),1,false),"select Col2")
Upvotes: 0
Reputation: 1
try:
=QUERY(SORT(FLATTEN(A1:1), FLATTEN(COLUMN(A1:1)), 0),
"where Col1 is not null")
or:
=INDEX(FLATTEN(VLOOKUP(ROW(A1), {ROW(A1), A1:1},
TRANSPOSE(SORT(SEQUENCE(COUNTA(A1:1))+1, 1, 0)), 0)))
Upvotes: 1