Page 227 - Excel Workbook for Dummies
P. 227

23_798452 ch16.qxp  3/13/06  7:40 PM  Page 210
                210       Part IV: Managing and Securing Data
                                    number of the last field in the data list (these numbers indicate the desired order of
                                    the fields). You then sort the list by column using this row as the sole sorting key.

                                    When sorting the columns in a data list, you must remember to click the Options
                                    button and select the Sort Left to Right radio button in the Orientation section of the
                                    Sort Options dialog box. Otherwise, Excel sorts your records instead of your columns
                                    and, in the process, the row of field names becomes sorted in with the other data
                                    records in your list!

                                    To see how to go about sorting the columns of a list, sort the columns of the Personnel
                                    Data List you worked with in the previous exercise so that the fields appear in the fol-
                                    lowing order: SSN, Department, Supervisor, First Name, Middle Name, Last Name,
                                    Title, Salary.

                          Try It


                                    Exercise 16-5: Sorting the Fields in a Data List
                                    Use the Personnel Data List in the Solved16-4.xls workbook file whose records you
                                    sorted in the previous exercise to practice sorting the fields of a data list:
                                     1. Select row 1 in the Personnel Data List worksheet and then insert a blank row
                                         (Insert➪Rows).
                                     2. Make the following numerical entries in the designated cells of the new, blank
                                         row 1:
                                            • 1 in cell A1
                                            • 6 in cell B1
                                            • 4 in cell C1
                                            • 5 in cell D1

                                            • 2 in cell E1
                                            • 3 in cell F1
                                            • 7 in cell G1
                                            • 8 in cell H1
                                     3. Make sure that the cell cursor is positioned in one of the cells in the range of the
                                         Personnel Data List (A1:H20) and then choose Data➪Sort to open the Sort dialog
                                         box.
                                         Note that Excel does not select the top row with the field ordering numbers.
                                     4. Select the No Header Row option button beneath the second Then By drop-down
                                         list box.
                                         Excel now selects the entire data list cell range, A1:H20, including the top row.
                                         Note that Column A is now automatically selected as the primary sorting key in
                                         the Sort By drop-down list box. However, you don’t want to sort the records of
                                         the list using the entries in column A. Rather, you want to sort the columns of
                                         the list using the entries in row 1. In order to do this, you must now change the
                                         sort orientation from its default of top to bottom to left to right.
                                     5. Select the Options button to open the Sort Options dialog box and there select the
                                         Sort Left to Right option button in the Orientation section before you select OK.
                                         As soon as the Sort Options dialog box closes, you see that the Sort By drop-
                                         down list box in the Sort dialog box now contains Row 1 as its setting.
                                     6. Select the OK button in the Sort dialog box to reorder the fields using the values
                                         in row 1.
   222   223   224   225   226   227   228   229   230   231   232