spreadsheet: sorting by the first n characters of the entries of a column then by another column

1

Is there any way to sort an OpenOffice Calc spreadsheet by the first n characters of a given column then by another criterion?

For example suppose that we have the following 4*2 spreadsheet (Note that all of characters are of text type, not necessary numbers)

124  2
144  3
127  1
139  4

For example I would like to sort (Ascending) by the first 2 characters of the first column then by the second column (Ascending).

The output should be:

127  1
124  2
139  4
144  3

Name

Posted 2014-08-18T14:37:32.133

Reputation: 255

Answers

3

I would make a third column (hidden if need be) which is just the left n characters of the first column. ie. LEFT(column; n)

Then you can sort by that column followed by your second column.

dehrg

Posted 2014-08-18T14:37:32.133

Reputation: 146

3Alternatively, build the entire sort key in the helper column: LEFT(column1, n) & column2. Note that the parameter delimiter in functions like LEFT may be either comma (,) or semicolon (;) based on your lo0cale. – Scott – 2014-08-18T18:50:15.863