Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multiple Sort ( ORDER BY ) within Query in Google Sheets

What am I missing here?

=QUERY('STUDENT SIGN IN'!A1:K, "select K,C,F,D,E,B ORDER BY A DESC, B"

The data is sorting on Column A, but doing nothing to Column B.

Since that didn't work, I also tried building it this way, however I haven't done a vested formula in sheets before. This formula is causing a #ERROR:

=SORT((QUERY('STUDENT SIGN IN'!A1:K, "select K,C,F,D,E,B)")Select 1,TRUE,2,FALSE))

like image 656
Kristi Miller Avatar asked Jan 31 '18 19:01

Kristi Miller


1 Answers

If the order for ColumnB is not changing then it is presumably already in the default (ascending) order within each ColumnA value. To reverse this as well as the order of ColumnA you might try:

=QUERY('STUDENT SIGN IN'!A1:K, "select K,C,F,D,E,B ORDER BY A DESC, B desc")
like image 131
pnuts Avatar answered Nov 15 '22 04:11

pnuts