« IBM's already making a difference: publicity about new office suites | Main | A podcast: Solveig Talks to Barton George from Sun »

September 19, 2007

Sorting: More powerful sorting using the Sort window

You want to do some good, hard sorting. Not just sorting by the first column, but by perhaps the third column. Maybe you want to sort first by state, then by city, then by last name. For that, you need the Sort window under Data > Sort.

You have your data.  Select all the data to sort, and either select the headings or not. You're good either way.
Sortmenu1

Choose Data > Sort.

Click the Options tab. You need to tell Calc whether you've got headings selected or not. If you've got headings selected, you want the option shown, "Range Contains Column Labels," to be selected. If you didn't, unmark it.
Sortmenu2optiostab

Now click the Sort Criteria tab. If you selected headings you'll see the headings themselves; if you didn't then you'll just see Column A, etc. Select the column to sort by, and Ascending or Descending.
Sortmenu3

Click OK.

You get your results. Here, the amounts under the column for the year 2000 are sorted in ascending order.
Sortmenu4

Now, let's look at a different set of data. You have a lot of people from the same state, and several cities per state. In this case you might want to just sort by last name, but you could also group by location. So you'd sort by state (the broadest category), then city, then alphabetically by last name. Click the image to see more detail.
Layer1

Select the data, with or without headings, and choose Data > Sort. In the Options tab, be sure to select the Range Contains Column Labels option if you selected headings.

In the Sort Criteria tab, select first State, then City, then Last Name.
Layer2

Click OK.

You get your results. Here's a closeup of one section, followed by the complete data. Click either to see them closeup.
Layercloseup

Layer3

This window that I've covered in this blog entry is pretty much what you need. If you want to go a little farther and sort by something else, like days of the week in the order they come, not alphabetical order, tune in for the next sorting blog.

TrackBack

TrackBack URL for this entry:
http://www.typepad.com/services/trackback/6a00d8341cdb1753ef00e54edef72c8833

Listed below are links to weblogs that reference Sorting: More powerful sorting using the Sort window:

Comments

Solveig, is there a way to help OO.o remember your sort criteria from sort to sort? I have one or two particular spreadsheets I resort every few days to every week. I've noticed that OO.o sometimes remembers what I want, and sometimes I have to respecify all the criteria. No, I haven't yet been observant enough to figure out a pattern.

very useful tips, just what I was looking for
thanks

Awesome tutorial Solveig, I definetly want to do a video tutorial out of this. Expect the youtube soon.

Hi JZA,

Include the URL of this post, if you would. Have fun! I look forward to seeing it.

Thanks,
Solveig

Hi Bill,

Sorry for the delay. I'm afraid I haven't noticed any sort of way to make OOo remember the criteria and/or what makes it do it when it does.

Solveig

Hey Bill

I think that you should make a macro to automatize your work. In this way you will speed up you work significantly.

Hello Solveig,

I never had a problem sorting my data in the OO spreadsheet until recently.
Instead of the usual numeric sorting I expected, it sorted my table alphanumerically.
I didn't find where to pick the sort type criteria from,

I appreciate your help,

dave

Hi Dave,

Select all the data and choose the headings, then choose Data > Sort and select the column to sort by. Click OK.

If that doesn't work, select the columns of numbers and choose Format > Cells, Number tab. Be sure they're the right format such as Currency or Number.

Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Working...
Your comment could not be posted. Error type:
Your comment has been posted. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.

Working...

Post a comment