I've setup a simple =QUERY statement that will pull targeted rows/columns out of a 'response' sheet and put them into a topic specific sheet.

=QUERY(responses!A1:K; "Select C, D, E where B contains '2nd Web Design' ") 

What I looking for is a way to "automatically sort" the rows being pulled by two methods.

  1. Alpha sort rows by one column
  2. Date/time sort rows by one column

Any suggestions on how I can modify the above QUERY to automatically sort the rows?

3 Answers

You can use ORDER BY clause to sort data rows by values in columns. Something like

=QUERY(responses!A1:K; "Select C, D, E where B contains '2nd Web Design' Order By C, D") 

If you’d like to order by some columns descending, others ascending, you can add desc/asc, ie:

=QUERY(responses!A1:K; "Select C, D, E where B contains '2nd Web Design' Order By C desc, D") 
4

Sorting by C and D needs to be put into number form for the corresponding column, ie 3 and 4, respectively. Eg Order By 2 asc")

0

You can use Col2 or Col3 to name de columns.

2

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy