Advanced Sorting
- 06:40
Understand how to sort rows and sort using custom lists
Glossary
Auto Fill Custom List Sort RowsTranscript
There's a couple of advanced features that are useful to know about when sorting. The first one we're gonna look at is sorting rows of data rather than columns of data. Let's have a look at what I've got here on the spreadsheet. If I go across to the right of my data here, I've just extracted the names of our salespeople into one single row, and I'd like to sort them alphabetically. So to do this, the first thing to know is that even though when we are sorting by columns, we said that there's no need to do any selection first. In this case, I do need to go and select the data. So, also, Excel was very good at recognizing the header row, whereas when we're sorting by rows in this way, Excel isn't good at doing that. So I need to make sure that I select exactly the data that I want to do the sort on. So I've ignored the header, I've just selected the things I want to sort. And then to do this, I've got to go into the sort dialogue box. So remember the shortcut for that was Alt + A + S + S. Alt + A + S + S.
And then under Options, you'll see that we've got, instead of top to bottom, we can sort by left to right. So that's the one I want to choose. Click OK.
Sort by should have just Row 4. Click OK again. And now you'll find that our salespeople are in alphabetical order. The second advanced feature I'd like to show you is called custom lists. Now, you've probably come across a custom list but you probably maybe just don't know that they're called custom lists. I'll give you an example of a custom list that exists already within Excel. If you type Monday into a cell, and then we use the AutoFill feature either by using the keyboard or by grabbing the mouse and just dragging down with a handle, you get the consecutive days of the week. And this is a custom list that already exists in Excel. There are four custom lists that come with Excel and they are like this. So we've got the full days of the week, then the abbreviated days of the week, so Monday, Mon, and so on. Then we've got months of the year, either fully spelled out and also the abbreviated version of months as well.
Okay, so those are all custom list, and they come standard when you get Excel. You can also though create your own. So how do we do that and why is that useful? Well, let's imagine, let's go back to our sort over here that we were looking at. Let's imagine that the person I'm producing this list for wants the locations sorted in a particular order. It's just the way they like them, okay? It's just the particular, maybe it's how they get split out by another program or whatever it might be. Somehow we need to filter these or to filter to sort these items into a particular order, not alphabetically. It's just arbitrary based on someone's preconceived ideas on how they want it sorted. So how do I do that? Well, to start with, we've got to have the order that we'd like. So here's the order that we've got. So I've got, this is the order I'd like them in. I'd like it sorted by south at the top, then the midwest, then the west, then the east. So there's no way I could do this alphabetically or even reverse alphabetically. This is a kind of just an arbitrary list that someone's made up this is the order it's supposed to be in. So my first job here is I need to create a custom list. Now, to do that, we select the data, the things that are gonna be on my custom list, then I'm going to go to file and option. So that is Alt + F + T. I'm gonna come down to the advanced section, and then we want to scroll all the way down till we get to almost towards the bottom. And you should find a button in the middle of your screen called Edit Custom Lists. Gonna click on this one. And you'll see those four custom lists that we described already. So the days of the week, both are full and the abbreviated, and the months of the year, full and abbreviated. Now I'm gonna create a new list. And to do that, you'll notice that we can import these from the cells that we already have are selected. And it's even picked this for us. So all we have to do is click on Import, and it's now brought those list entries in, and then we just click on OK, and then OK again. And we'll have created our custom list. How do I know I've created a custom list? Well, I can start typing any member of that custom list, and then I can use my AutoFill cursor to complete the list. So now we have our custom list. Now you are asking, how does this help with our sorting? Well, this now means that when I come into this column and we go into our sort dialogue box, so Alt + A + S + S, then when we've got sort by and I can choose or better go into Options and say we're gonna sort top to bottom first. Otherwise, it really will get confused. And I've got header rows. So now I can say, right, I want to sort by Location, and where I've got sort on Values. That's correct. I'm still sorting the values. The order I'd like is not A to Z or Z to A, it's by custom list. So now I can go and pick my custom list, choose the custom list I've just created, click OK, OK again. And now we'll find that we have all of the south together. And then all of the next one, the midwest, I think was the next one we had in our list. And then we had the next section, and so on, and so on, and so on. So we have this list now sorted in the order we'd like it.
So a couple of advanced features there. I hope you found that useful.