• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL

Part 3. Using Excel > Task 11 How to Sort Data

Task 11 How to Sort Data

Excel can be used as a database, a tool for organizing data. For example, an inventory database might contain fields (columns) for product name, product number, and price. A record (row) is a complete entry in the database with data recorded for each field. You can sort a data list to see product names in alphabetical order, for example, or product prices from highest to lowest. When you sort a list, the entire list is sorted; each record (row) in the list retains its integrity. Other tables on the same worksheet are not affected by the sort because Excel sorts only the table in which the active cell is located (the table in which you click a cell). For Excel to sort data correctly, you must set up your table precisely. First, type a row of column labels (such as Product ID, Product Name, Price, and so on). In the row below that, type the data for your first product. Do not skip rows.

  1. Select a Field

    To sort by a single key, or field (column), click any of the table data cells in that column (not the column label). For this example, I want to sort the data in the table by the Product Name column, so I click cell B5 (not B4).

  2. Select a Sort Order

    To sort the data in alphabetical order (A to Z) or in lowest-to-highest numerical order, click the Sort Ascending button on the Standard toolbar. To sort in reverse alphabetical order (Z to A) or in highest-to- lowest numerical order, click the Sort Descending button.

  3. Sort by Multiple Fields

    To sort the data by multiple fields (for example, by last name and then by first name)—a process called a multikey sort—click anywhere in the table data and choose Data, Sort to open the Sort dialog box.

  4. Set the Second Field

    From the Sort by drop-down list, select the field you want to use for your major sort. Then select the option button for the sort order you want (Ascending or Descending). In this example, I'm sorting an address table in A to Z order by the Last Name column.

  5. Set the First Field

    For the second key in the sort, click the Then by drop-down arrow and select the column you want to use for the secondary sort (in this example, my second key sort is the First Name column). Then choose the option button for a sort order. To sort by a third key within the second key (for example, to sort the first and last names by the State column), use the second Then by drop-down list. Click OK to run the sort.

  6. Results of a Multikey Sort

    Shown here is the result of the three-key sort: first by Last Name, and then by First Name, and then by State. If two people have the same last name, they are sorted by first name; if both the first and last names are the same, they are sorted by state.



Not a subscriber?

Start A Free Trial

  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint