I have a google spreadsheet that uses the following query:
=query('Respostas do Formulário 1'!A1:AG;"select D,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,AA,AB,AC,AD,AE,AF WHERE B='7ºA' order by D ASC";1)
However column D from sheet: "Respostas do Formulário 1", has values with a number then a name in front and when it performs the query in sheet1 I wanted it to order ASC, like 1, 2,3,.., 10, 11,12.. But as you see in the image that is not happening...
Is there anyway I can accomplish this?
If you always have a hyphen (-) after the number, you could try extracting the number and sorting on it before doing the query:
=query(sort(A:A,value(left(A:A,(search("-",A:A)-1))),true),"Select Col1 where Col1<'999'")
(change ranges to suit).