Home > Software design >  Can you help me fix this google sheets formula to sort by col5 ascending?
Can you help me fix this google sheets formula to sort by col5 ascending?

Time:11-10

Here is my current formula that works perfectly...

=QUERY({IMPORTRANGE("https://docs.google.com/spreadsheets/d/1BNomeoTxYiT4A1A0i8jhRIPtTfZN0GtbQQ4Intp7lMY", "'MASTER'!A2:Z100");IMPORTRANGE("https://docs.google.com/spreadsheets/d/1BNomeoTxYiT4A1A0i8jhRIPtTfZN0GtbQQ4Intp7lMY", "'SPOTS'!A2:Z100")},"select * where LOWER(Col1) contains '"&lower(Structure!N$8)&"' and Col2 = date '"&TEXT(Structure!M$8,"yyyy-mm-dd")&"'",1)

All I want to do is sort by Col5 ascending. I've tried to add it in multiple ways and keep getting an error. Can anyone help edit this formula to add "sort by col5 asc"?

CodePudding user response:

try:

=QUERY({
 IMPORTRANGE("1BNomeoTxYiT4A1A0i8jhRIPtTfZN0GtbQQ4Intp7lMY", "'MASTER'!A2:Z100");
 IMPORTRANGE("1BNomeoTxYiT4A1A0i8jhRIPtTfZN0GtbQQ4Intp7lMY", "'SPOTS'!A2:Z100")},
 "where LOWER(Col1) contains '"&LOWER(Structure!N$8)&"' 
    and Col2 = date '"&TEXT(Structure!M$8, "yyyy-mm-dd")&"' 
  order by Col5 asc", 1)
  • Related