Take the 2-minute tour ×
Web Applications Stack Exchange is a question and answer site for power users of web applications. It's 100% free, no registration required.

When I'm working in a Google Spreadsheet, I always use the same routine to perform a sort.

Are there more ways to sort, that lead to Rome?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

There are four ways for you to perform a sort. See list below in no particular order:

First (sheet)

Add the build-in filter function, by pressing the funnel and selecting the first row:
enter image description here
Then select the green down arrow in columnA, followed by descending (Z --> A):

enter image description here

Second (sheet)

Use this formula, on another sheet, to perform the sort you want:

=SORT('Build-in SORT'!A2:D,1,0)

Syntax of the sort is: SORT(range, column, sorting order)

Third (sheet)

With the usage of a script, complex sorting is possible as well. This one creates a menu item called Extra, containing an item called Sort:

function onOpen () {
  var ss = SpreadsheetApp.getActiveSpreadsheet();
  var menu = [{name: "Sort", functionName: "mySort"}];
  ss.addMenu("Extra", menu);
}

function mySort() {
  SpreadsheetApp.getActiveSpreadsheet().getSheets()[2].getRange("A2:D")
    .sort({column: 1, ascending: false});
}

Goto Tools, Script Editor, from the menu and add the script. Make sure to press the two buttons:

enter image description here

Fourth (sheet)

Select column A and choose Data from the menu. Select "Sort sheet by Column A, Z --> A"

enter image description here

Make sure to fix the first row (otherwise the header will join the sort....) !!

Example File

I've prepared the following example file: Four Different Sorts

share|improve this answer

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.