I am going to guess from the presence of an ID field and from the error message that your sheet is linked to a form.
Duplicate the sheet and perform the desired operations on the duplicate.
Spreadsheets containing form responses don’t currently allow for filtering, column shifting, or other such changes. The reason for these restrictions is that changes like filtering the main spreadsheet’s data will actually disrupt its ability to accept form responses properly.
These restrictions exist whenever you have linked your spreadsheet to a form. If you’d like to sort your data, you can always duplicate or copy your sheet by clicking on the sheet tab and selecting “Duplicate.” This duplicate sheet will contain all of your form data and will allow you to sort and filter as you wish.
http://www.google.com/support/forum/p/Google%20Docs/thread?tid=540148364a65c6fc
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:
Then select the green down arrow in columnA, followed by descending (Z --> A):
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:
Fourth (sheet)
Select column A and choose Data from the menu. Select "Sort sheet by Column A, Z --> A"
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
Best Answer
Not an easy problem to solve with spreadsheet formulas, so I came up with something in Google Apps Script that seems to work.:
To use this script, go to your spreadsheet, click Tools → Script Editor and paste the above script. Save.
Now find the cell where you want the results to appear. In that cell, enter
=alternateSort(A2:D9; 3)
where you replaceA2:D9
with the area where your input data is, and3
with the number of the column which will be used for sorting.I created an example spreadsheet to demonstrate: https://docs.google.com/spreadsheets/d/1RLNByCIIW6lgJWrbXNaIQpSj-fD3yqBu4YR4DQJNGIY/edit?usp=sharing - feel free to copy it to your own drive for experimentation.