Web Applications Stack Exchange is a question and answer site for power users of web applications. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Having a table with data like:

-   +   +   -
-   -   -   -
+   +   -   -

where + and - are created via '-, '+ commands, How to sort it recursively (probably other word shall be used) meaning sort by first column, group -> sort each group by second column, group -> ... for first N columns?

share|improve this question

migrated from superuser.com Apr 27 '13 at 0:18

This question came from our site for computer enthusiasts and power users.

There is a way to do it, but it's a bit cumbersome. I've prepared the folowing data in the DATA sheet:
enter image description here

In another sheet (SORT) you can apply the SORT function:

This will yield the following: enter image description here

Now you will be able to change the sort by changing the second row (sheet DATA) from 0 to 1. You can even change the column numbering. The SORT function allows for up to 30 different sorting options. You need a very big pool of data, in order for it to be effective.

See example file I created: Sort With Many Columns

share|improve this answer

You cannot, like in other spreadsheet programs like f.e. Excel, define explicitly on what list of columns to sort on in what order.

However, you can achieve the same result manually. If you wanted f.e. to primarily sort by column A and secondarily by column B, you can just first sort everything by column B and afterwards by column A.

This works because, when sorting on a certain column, the order of elements with the same value for that column will remain the same.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.