Home > Software design >  Google Sheet: How to reverse and transpose a row?
Google Sheet: How to reverse and transpose a row?

Time:12-19

Need to reverse and transpose a row in google sheet

enter image description here

like below

enter image description here

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")

enter image description here

CodePudding user response:

=SORT(TRANSPOSE(A1:E1),SEQUENCE(COLUMNS(A1:E1)),)
  • SEQUENCE to create a array of sequential numbers
  • SORT 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)
  • Related