0% found this document useful (0 votes)
3 views

Sorting Data Practice

The document provides instructions on how to sort data in Excel, including basic sorting, sorting by a single column, and using custom sorts with multiple levels. It includes exercises to practice sorting by age, salary, education, and meal ratings, as well as creating custom lists for natural order sorting. Users are guided on how to maintain data integrity while sorting and how to utilize Excel's features effectively.

Uploaded by

daycarlson23
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as XLSX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Sorting Data Practice

The document provides instructions on how to sort data in Excel, including basic sorting, sorting by a single column, and using custom sorts with multiple levels. It includes exercises to practice sorting by age, salary, education, and meal ratings, as well as creating custom lists for natural order sorting. Users are guided on how to maintain data integrity while sorting and how to utilize Excel's features effectively.

Uploaded by

daycarlson23
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as XLSX, PDF, TXT or read online on Scribd
You are on page 1/ 10

Sorting Data

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.

Sorting a Column Separately


We just learned that when you select a single cell before sorting, rows stay in
tact, which we usually want. If you select a range, such as the entire Salary
column, and then sort, you will be asked if you want to expand the selection to
the full data set or continue with the current selection. You almost always want
to expand the selection. If you continue with the current selection, only the
Salary values will be sorted, so the sorted salaries will not correspond to the
right people. Note that sorting on ID will not fix this!
Exercise 2
First, return the data to its original order by sorting A-Z on Person. Then, sort
the Salary column (A-Z), by first selecting the column from S13 to S35, then sort
without expanding the selection, i.e., click Continue with the current selection.
The highlighted cells for Person 10 should make it easy to see that the rows do
not stay intact when you sort on a single selected column. Enter in L36, the
salary amount that is now in the row of Person 10.

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.

Create a Custom List for Sorting


Sometimes you want to sort in a "natural" order, such as months in a year (Jan,
Feb, etc.) or days of the week (Sun, Mon, etc.). You can do this with a custom
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.

Create a Custom List for Sorting


Sometimes you want to sort in a "natural" order, such as months in a year (Jan,
Feb, etc.) or days of the week (Sun, Mon, etc.). You can do this with a custom
list. To get to this option, bring up the Custom Sort dialog box, click the Order
dropdown, and select Custom List. (You can also get to the Custom Lists dialog
box from the Advanced group under File/Options.) As shown below and to the
right, you will see several custom lists built into Excel: the months of the year
and the days of the week, either three-letter abbreviations or written out. You
can also click NEW LIST and enter your own custom list. This new custom list is
remembered on your computer for later uses.

Mac Users: To add a custom list, follow these instructions:


1) On the Excel menu, click Preferences, and then under Formulas and Lists,
click Custom Lists .
2) Type the values for your list in the order that you want them sorted, with a
comma between each value.
3) When you are finished, click Add, and then close the Custom Lists box.

Short video showing these MacSteps: https://tinyurl.com/2ar9f9wc


Exercise 4
Sort the data below and to the right, on Meal
Rating A-Z. In L81, answer Yes or No, does your
sort put the meal ratings in the natural rank
order?
Exercise 5
Create a new custom list with items One star, Two stars, Three stars, Four stars,
Five stars, in this order. Then, perform a custom sort that uses your new custom
list to sort Meal Rating as the first level, and the built-in custom list for Day as
the second level. In L86, enter the Order ID that appears in the top row after
sorting.

Save this file and submit it via Canvas.


A-Z and Z-A buttons on Data ribbon

Person Age Education State Children Salary


1 35 HS Ohio 1 $65,400
2 61 College Illinois 2 $62,000
3 35 College Illinois 0 $63,200
4 37 HS Indiana 2 $52,000
5 32 HS Ohio 3 $81,400
6 33 College Illinois 3 $46,300
7 65 College Illinois 2 $49,600
8 45 HS Ohio 1 $45,900
Ex 1: 9 40 College Illinois 3 $47,700
10 32 Grad School Ohio 1 $59,900
11 57 HS Illinois 1 $48,100
12 38 Grad School Indiana 0 $58,100
13 37 Grad School Indiana 2 $56,000
14 42 Grad School Ohio 2 $53,400
15 38 College Ohio 2 $39,000
16 48 HS Ohio 1 $61,500
17 40 HS Indiana 0 $37,700
18 57 College Indiana 2 $36,700
19 44 HS Illinois 2 $45,200
20 40 HS Ohio 0 $59,000
21 21 HS Indiana 2 $54,300
22 49 HS Ohio 1 $62,100
Ex 2:

Custom Sort button on Data ribbon Custom Sort dialog box


Person Age Education State Children Salary
Ex 3: 1 35 HS Ohio 1 $65,400
2 61 College Illinois 2 $62,000
3 35 College Illinois 0 $63,200
4 37 HS Indiana 2 $52,000
5 32 HS Illinois 3 $81,400
6 33 College Illinois 3 $46,300
7 65 College Illinois 2 $49,600
8 45 HS Ohio 1 $45,900
9 40 College Illinois 3 $47,700
10 32 Grad School Ohio 1 $59,900
11 57 HS Illinois 1 $48,100
12 38 Grad School Indiana 0 $58,100
13 37 Grad School Indiana 2 $56,000
14 42 Grad School Ohio 2 $53,400
15 38 College Ohio 2 $39,000
16 48 HS Ohio 1 $61,500
17 40 HS Indiana 0 $37,700
18 57 College Indiana 2 $36,700
19 44 HS Illinois 2 $45,200
20 40 HS Ohio 0 $59,000
21 21 HS Indiana 2 $54,300
22 49 HS Ohio 1 $62,100

Order ID Meal Rating Day


Ex 4: 1 One star Monday
2 Five stars Monday
3 Five stars Thursday
4 Three stars Saturday
5 Five stars Saturday
Ex 5: 6 Five stars Tuesday
7 Four stars Sunday
8 Three stars Wednesday
9 Three stars Thursday
10 Four stars Monday
11 Five stars Tuesday
12 One star Sunday
13 Four stars Tuesday
14 Five stars Friday
15 Five stars Saturday
16 Five stars Thursday
17 Five stars Wednesday
18 Four stars Thursday
19 Five stars Friday
20 Two stars Wednesday
rt dialog box
Custom Lists dialog box
$49,600

$52,000
35

No

12

You might also like