I have a spreadsheet with lots of related rows. How can I sort the entire sheet in such a way that rows that belong together stay together in groups, and the groups instead are sorted by some common property?For example, this sheet with 6 groups and 2 columnsset1    element1     1set1    element2     33set1    element3     ?set1    element4     5set2    element5     1set3    element6     6set4    element7     14set4    element8     14set5    element9     3set6    element10    1set6    element11    8set6    element12    13Some criteria I'd like to sort by:Order groups so ones that have at least one '?' in column C are on top,Order groups by the minimum/maximum/average/etc value of all cells in column C of the group that are not '?'The relative order of rows inside of groups should not be changed.I realize this will require some scripting, but I've only done 1-line scripts before and even those were found here, so I can't do this by myself. With regards to the processing time, the sheet is about 11270x20 cells and two columns are filled with formulas like the following:=if(isdate(F4),if(F4=?,?,(year($F4)-2000)*4+floor(($F4-date(year($F4),3,1)+if(month($F4)<3,60,59)+13.3)/91.8,1)),)=if(and(E3=,H3=),,if(isnumber(H3*E3),H3*E3,?))
How to sort groups of rows in Google Sheets?
sorting;google spreadsheets