- [Instructor] We've spent all that time
putting data into Excel.
Now let's do some sorting so that we can analyze it
and get the data out.
I'd like to sort by size so that I can quickly see all
of my eight ounce olive oils
and my 64 ounces altogether in one place.
Excel makes it easy.
I did want to point out that over here on the right hand side,
I have a little column of sizes.
I don't want to sort that, so you'll need to be aware
that if there's any data you don't want to sort,
you either have to select everything ahead of time
or make sure there's at least one empty column of space
in between that other column that you don't want to sort.
Something else that you can do
is check the boundaries of what you're sorting.
Excel is smart enough to know
that any adjacent columns
will also be included in that sort.
So when I sort by size,
it's automatically going to rearrange
all of the other columns
and keep everything all together on their respective rows.
If you ever want to make sure,
just hit control A on your keyboard.
That's going to select all of the data,
but you can also hit control plus the period key.
And as I keep hitting this,
it's going to move around to every boundary.
You can see the top right boundary,
and here's the bottom ones.
This will help you make sure
it's going to sort exactly what you want it to.
Now I'll click inside
anywhere in this column that I want to sort by.
And on the home ribbon tab, I'll click sort and filter.
I would like to sort this smallest to largest.
Excel is smart enough to realize
that the column was numerical, and instantly, it sorts.
It keeps everything else together
so that all of my columns and rows match up.
And here's my 8 ounce data, my 16 ounce, and so on.
You can even sort by more than one column.
That's called a secondary sort.
In fact, you could keep going
and add more columns to sort by.
Let's check out this worksheet,
which contains an employee directory.
I'd like to sort this by department,
and then I'd like to put a secondary sort on it
to sort by extension.
This is a great example to show you,
because not only can you sort alphabetically,
you can also sort numerically,
and even in the same sort algorithm.
So what I'll do first is select my department,
and then on the home ribbon tab
I'll click sort and filter again.
But this time, I'm going to choose custom sort.
Now, you'll immediately notice
that there's a section here that says "My data has headers",
and it has a check mark next to it.
Excel put that check mark on it
because it detected that I have these header titles here,
and it's going to leave that out of the sort
so it doesn't include it and sort by the word "department".
So if you don't have headers,
make sure you don't have a check mark next to this.
Here's all my columns,
and I can come down here and choose to sort by department.
It's even taken those headers and put them in this field.
I do want to sort on cell values,
although if I change the cell color or the font color,
I can even sort on those.
And we're going to talk about
conditional formatting in a little bit.
You can even sort on those icons.
And finally, the sort order, I would like it to be A to Z.
Here's where I'm going to choose add level.
So first we're going to sort by department
and then by extension.
And again, I'm going to sort on the values
that are in the cell.
And because Excel has detected that extension is numerical,
it's already asking me to sort by smallest to largest,
though I could change that if I wanted to.
Now I could keep going.
I could click add level and sort by any of these columns,
but I'm going to leave it at that and click okay.
It instantly rearranged all my data.
Here's my departments,
and those departments are sorted by extension.
For example, the facilities team is much smaller,
and I can see that those are still in order.
At any time, I can change the sort order.
Suppose I wanted this sorted alphabetically by last name.
I'll select this column, click sort and filter,
choose from A to Z, and now it's sorted.