2

I am trying to make a query and drop it into a table (really only a 5x5 grid of boxes with a black border color), but I want it to be ordered by row instead of column. I currently have the formula =QUERY(B14:J14) and I tried to make it =QUERY(B14:J15,"order by 15") but an error message came up because you can't use order to order by the row. Can someone please tell me if there is a way to make the query order by row number instead of by the column letter?

Josh Smith
  • 84
  • 1
  • 14
  • 1
    I suspect you can do this, by rotating it twice. Not sure what the function is, I would ask on the "google spreadsheet forum". – eddyparkinson Oct 15 '14 at 00:00

1 Answers1

2

@eddyparkinson is correct, just need to "double transpose".

=TRANSPOSE(QUERY(TRANSPOSE(B14:J15),"order by Col2"))

AdamL
  • 23,691
  • 6
  • 68
  • 59
  • Thanks, Adam. This helped me a lot. But, I believe that you need to switch `Col2` to `Col1`.That's what I did because an error message came up saying there was no `Col2` – Josh Smith Oct 15 '14 at 12:17
  • Wait. . . I realized that now, it orders reverse the way I want to make it order. Is there any way I can make it order the other way, or transpose it 2 more times? – Josh Smith Oct 15 '14 at 17:44
  • There will be no Col2 I'd there is only one row (one of your examples suggested there were 2 rows). If you want sort descending, use "order by Col1 desc". – AdamL Oct 15 '14 at 19:15
  • Thanks! That will help me a lot in the future, since I was previously making it go the other way, which was really bad! :-) – Josh Smith Oct 15 '14 at 19:41