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)<>"")
CodePudding user response:
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)))
CodePudding user response:
Try
=query(sort(transpose({ARRAYFORMULA(column(A1:E1));A1:E1}),1,false),"select Col2")
CodePudding user response:
=SORT(TRANSPOSE(A1:E1),SEQUENCE(COLUMNS(A1:E1)),)
SEQUENCE
to create a array of sequential numbersSORT
to sort them in reverse
If 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)