MS-Excel / Excel 2003

Excel Sort Feature

Excel's Sort feature makes it easy to rearrange the records or even the fields in your table of data or data list. 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 will be reordered during sorting.

When a key field contains duplicate entries, Excel lists these records in the order in which they were entered in the table or data list. To indicate how Excel should order records with duplicates in the primary key, you define a secondary key. For example, if, when organizing the data list in alphabetical order by the Last Name field, you have several records where the last name is Smith, you can have Excel sort the Smiths' records in alphabetical order by first name. To do so, you define the First Name field as the secondary key. If the secondary key contains duplicates (say you have two John Smiths in your company), you can define a third key field (the Middle Name field, if your data list has one) that determines how the duplicate John Smith records are to be arranged when the data list is sorted.

When defining the key fields or rows for a sort, you can specify either an ascending or descending sort order for its data:

  • When you specify ascending order (which is the default), Excel arranges text in A-to-Z order and values from smallest to largest.
  • When you specify descending order, Excel reverses this order and arranges text in Z-to-A order and values range from largest to smallest.

When sorting on a date field, keep in mind that ascending order puts the records in least-recent-tomost- recent date order, whereas descending order gives you the records in most-recent-to-least-recent date order.

When you choose the ascending sort order for a field containing many different kinds of entries, Excel places numbers (from smallest to largest) before text (in alphabetical order) followed by logical values (TRUE and FALSE), error values, and, finally, blank cells. When you're using the descending sort order, the program uses the same general arrangement for the different types of entries, but numbers go from largest to smallest, text runs from Z to A, and the FALSE logical value precedes the TRUE logical value.

[Contents] [Next]