Sorting Data Practice
Sorting Data Practice
Sorting Data
Sorting orders data alphabetically or numerically. You can order your data by
increasing or decreasing values, or by a custom list when needed.
Basic Sort: A to Z or Z to A
The usual situation is that you have a data set such as the one to the right. If
you want to perform a simple sort on any of its columns, select any single data
cell in the column and click the A-Z or the Z-A button. You can find these
buttons on the Data ribbon, or under the Sort & Filter dropdown on the Home
ribbon.
You can undo a sort, but it is often useful to have an ID column with
consecutive integers, 1, 2, 3, etc., which allows you to easily sort back to the
original order.This is the role of the Person column.
Exercise 1
Sort on the Age column to the right, either in A-Z or Z-A order. Note that when
you sort on any column, the other columns change accordingly. That is, each
row remains intact. The highlighted cells for Person 10 make it easy to see how
the cells in a row stay together. Once you sort on Age, it will be easy to identify
the age of the oldest person, then read across the row to see their salary. Enter
the salary amount for the oldest person in L22.
Custom Sorts
Excel gives you many more sort possibilities with its Custom Sort item under
the Sort & Filter items (on both the Home and Data ribbons). When you click
either of these, you see the Custom Sort dialog box to the right where, among
other things, you can add levels. The data set below, to the right (a copy of the
original data above) illustrates why you might want to do this. Suppose you
want to sort so that all of the people whose education attainment is College are
at the top. Then within each Education category, you would like to sort in A-Z
order on State. Then if there are multiple people of a given education
attainment in the same state, you would like to sort them in increasing order of
Salary. This is possible only with a custom sort with three levels: first Education,
then State, then Salary, as shown to the right.
Exercise 3
Sort the data set to the right using a Custom Sort, first on Education in A-Z
order, then State in A-Z order, then Salary in increasing order. In L56, enter the
age of the person in the last row of the data sorted on these three levels.
Exercise 3
Sort the data set to the right using a Custom Sort, first on Education in A-Z
order, then State in A-Z order, then Salary in increasing order. In L56, enter the
age of the person in the last row of the data sorted on these three levels.
$52,000
35
No
12