Sorting data

Calc has a sort feature that will let you dynamically change the order of data in your spreadsheet.

Suppose you want to view the entire sheet ordered by category.

First, select the data to sort. Let’s sort the entire sheet by clicking on the upper left area of the grid. Next, choose the sort option from the data menu.

Before defining the sort conditions, display additional sort options by clicking the options tab.

For now, let's take a look at the “range contains column labels” checkbox. Because you selected the entire sheet, the range does contain column labels. If we leave this box checked Calc will leave the first row alone and rearrange the sort order of all the other rows in the range.
In this case, that’s what we want.

You'll notice there are lots of other options on this screen. We'll take a closer look at them in the next example. For now, let's set the sort options by clicking on the sort criteria tab.

First, we'll sort the data by category. Then, we'll choose the ascending order option. Ascending order will arrange text values in alphabetical order, numeric values would be arranged from smallest to largest.

Descending order is just the opposite.

If all you want to do is to sort the data by category, you could click the OK button now and be done.

Let's take it a step further and apply a second set of sort criteria. What if you wanted to first sort the data by category then sort the values in each category by another column - by item name for example.

You've already set up the first sort. All that’s left is to set up the second sort. Choose “item” from the second list and select ascending order.

Click the 'OK' button, and you'll see that Calc has sorted the data first by category, then by the secondary sort criteria – the item name.

 
previous | table of contents | next
© copyright 2005 LearnOpenOffice.org