|
Excel's Sort feature makes rearranging the records or even the fields in your table of data or data list easy. To sort your data, Excel uses sorting keys to determine how the records or fields should be reordered in the data list:
- When sorting records, you indicate by cell address which field (that is, column) contains the first or primary sorting key.
- When sorting fields, you indicate which record (row) contains the primary sorting key.
Excel then applies the selected sort (ascending or descending) to the data in the key field or row to determine how the records or fields should be reordered during sorting.
To sort the records in your Excel data list with the Sort feature, follow these steps:
1. Position the cell pointer somewhere in one of the cells in the data list.
As long as the cell pointer is in any cell in the data list, Excel automatically selects all the records in the list when you perform the next step.
2. Choose Data --> Sort to open the Sort dialog box.
Excel selects all the rows (records) in the list (excluding the row of field names at the top) and opens the Sort dialog box.
 | If the list of data you're sorting doesn't have a row of headings in the top row and you want to include the top row's data in the sort, you need to select the No Header Row option button near the bottom of the Sort dialog box. |
3. In the Sort By drop-down list, select the name of the field you want used as the primary key in sorting the records.
4. If you want to sort the records in descending order (rather than the default ascending order) using the primary key, click the Descending option button.
5. If the primary key field contains duplicates and you want to specify how these records are to be sorted, select the name of the field to sort by in the first Then By drop-down list to specify a secondary key.
6. If you want to sort the records in descending order using the secondary key, click the Descending option button to the right of the first Then By drop-down list box.
7. If the secondary key field contains duplicates and you want to specify how these records are to be sorted, select the name of the field to sort by in the second Then By drop-down list to create a tertiary key.
8. If you want to sort the records in descending order using the tertiary key, click the Descending option button to the right of the second Then By drop-down list.
9. When you finish defining all the keys you need to use in sorting the records in your data list, click OK or press Enter to perform the sort.
 | If, when Excel finishes rearranging the records, you find that you sorted the data list using the wrong key fields, choose Edit --> Undo or press Ctrl+Z to restore the data list records to their previous unsorted order. |
Note that the Sort dialog box contains an Options button that, when clicked, opens the Sort Options dialog box. This dialog box contains options for doing a case-sensitive sort on fields that contain text and options for changing the orientation of the sort from the normal top-to-bottom order to left-to-right order when you want to sort columns in a list.
|