Locked lesson.
About this lesson
Learn to sort data in Excel by a single column or by multiple columns.
Lesson versions
Multiple versions of this lesson are available, choose the appropriate version for you:
Exercise files
Download the ‘before’ and ‘after’ Excel workbooks from the video tutorial and try the lesson yourself.
Sorting.xlsx17.6 KB Sorting - Completed.xlsx
17.6 KB
Quick reference
Topic
Sorting data in Excel by a single column, or by multiple columns.
When to use
Knowledge of how to use Excel’s sorting feature can be essential for presenting your data in an easy to read format.
Instructions
Preparing your data for sorting
- Make certain that your data is in tabular format
- It is essential that there be no blank rows or columns interrupting the data that you wanted sorted
- While not essential, it is certainly preferable to have a clear header row for your data
Single level sorts
- Select any cell inside your data table (or the entire range you want to sort)
- Go to Data > Sort
- Configure the way you’d like it sorted, then click OK
Multiple level sorts
- Multi-level sorts allow you to sort by one column, then use another column to sort ties
- Select any cell inside your data table (or the entire range you want to sort)
- Go to Data > Sort
- Configure the primary sort the way you’d like to see it
- Click Add Level
- Configure the secondary sort the way you’d like to sort the ties
- You can continue to add as many sorting levels as you need
- 00:05 In this video we're going to look at sorting data in Excel.
- 00:09 You can see that I have some data here that is already ready to be sorted.
- 00:14 And when I say already ready,
- 00:15 there's some keys here that I want you to recognize about this data.
- 00:19 Number one, it's in a good, tabular format right off the bat.
- 00:23 And by that I mean it looks like a table.
- 00:25 It's all set up,
- 00:25 it's got some nice consistent data types down the individual columns.
- 00:29 We've got text down here and numbers and percentages and more values over here.
- 00:33 There's no blank rows and there's no blank columns anywhere in the data.
- 00:38 And that's really important because when Excel tries to sort, it's going to try and
- 00:43 say, where is the data range?
- 00:44 And it looks until it finds the first blank row or blank column.
- 00:48 And at that point, it stops looking anymore and says,
- 00:51 this is the data you want sorted.
- 00:52 Now, you can override that, but ultimately, you shouldn't want to.
- 00:57 The next thing is, is that has a nice header row and
- 00:59 while this is not essential for your data source, it's certainly makes it easier.
- 01:04 And we'll show you why as we go through here.
- 01:07 So first thing is let's do a single level sort
- 01:11 which is sorting the credit cards in ascending order by name.
- 01:15 We've got a couple of different places we can do this.
- 01:17 We can go to Sort and Filter and we can use the Sort A-Z right here.
- 01:22 Or we could do the same thing by going to the Data Tab, and
- 01:25 we've got the buttons in this particular area as well.
- 01:28 So, when we click sort, you'll notice that it did not sort the headers into the data,
- 01:32 it recognizes those as headers.
- 01:34 We could flip this around and go with our Visas first and then our MasterCards,
- 01:39 going Z to A.
- 01:42 But what if we wanted to sort these, and
- 01:45 say you know I'd really rather actually go and sort this by the maximum balance?
- 01:49 Well that's no problem, I'll click in the maximum balance column, and
- 01:52 I'll click to sort, set to A here.
- 01:55 So it resorts all of the columns here.
- 01:58 Now, within this though, I would actually like to go and
- 02:02 start sorting this differently.
- 02:03 Because right now I've got this sorted in descending order.
- 02:07 But when you look at ties in this case,
- 02:11 they're also sorted in descending order and I'd like to change that.
- 02:14 So I wanna set up a multiple level sort here.
- 02:17 The way we do it, is we click anywhere inside our data, and
- 02:21 we click the sort button.
- 02:23 And this will allow us, and this is why header rows are very useful,
- 02:27 is that it picks off that header row right off the bat.
- 02:29 Now if you have a header row, and for whatever reason,
- 02:31 Excel doesn't recognize it.
- 02:33 That's why you can check this little box on the side here that says my data has
- 02:36 headers.
- 02:37 So what we're gonna do is we're first gonna sort by the maximum balance
- 02:41 on values and we'll go largest to smallest.
- 02:43 And then what we'll do is say add level.
- 02:46 And when we add a level, we've got a new sort level that we can work with to say,
- 02:51 give me the credit card, and sort this one from A to Z.
- 02:56 And then, if I had a tie with credit cards, maybe I could say, you know what,
- 02:59 and then sort it by the annual interest rate,
- 03:03 from the largest to the smallest, so that I know which cards are there.
- 03:07 This isn't going to be a case in this particular set,
- 03:09 but when we actually go and say, okay now.
- 03:12 You'll notice that It's sorted by maximum balance,
- 03:15 descending, within ties, were sorted in ascending order.
- 03:20 So once again, here's another tie, it's ascending order with the M's first, and
- 03:24 the V's second.
- 03:25 So, this is kinda nice.
- 03:26 We've got the ability to go in and set up our sorts any way we want.
- 03:31 When you leave the table, if you come back into your table, and
- 03:34 you click sort again, you'll see that it preserves those levels.
- 03:37 If you wanna get rid of one or move them around,
- 03:39 let's say we wanted to sort by the credit card first.
- 03:43 We could select it and we could say, move up.
- 03:46 If we want to get rid of a level, we select it and we can say, delete level and
- 03:50 the level goes away.
- 03:51 You'll also want to know that we're not restricted to sorting just on
- 03:55 the values either.
- 03:56 If you notice, we can sort based on cell colors or
- 03:59 font colors even cell icons if we happen to have icons in the cells as well.
- 04:04 So that's pretty powerful stuff not being restricted to just dealing with text.
- 04:08 So I hope you enjoy that.
- 04:10 That is the different options we have for sorting data in Excel.
Lesson notes are only available for subscribers.