Hi, this is Gary with MacMost.com.
Today let's take a look at the basics of sorting in Numbers.
MacMost is brought to you thanks to a great group of more than 750 supporters.
Go to MacMost.com/patreon.
There you could read more about the Patreon Campaign.
Join us and get exclusive content and course discounts.
So here I've got a sample table in Numbers.
Pretty basic information.
Just last name, first name, two columns of dates and two columns of numbers here.
Now if I want to sort by a column it's pretty simple to do.
All I need to do is click anywhere in the table so the table is the one selected.
Then if I move my cursor over the top here you could see for each column I have this
little arrow here and if I click on it I get some quick actions.
One of those quick actions is to Sort.
As a matter of fact there's two of them.
Sort Ascending and Sort Descending.
So one thing I might want to do is sort by last name ascending and I can select that
and it resorts the whole table now with last name starting with A and going to Z.
Now you could do the same thing for any other column.
I could do it for the birthday column here.
Sort Ascending or Descending.
Numbers knows if it's a date it should sort by date and not by alphabetizing the date.
I could do the same thing with numbers here.
I can sort by score and go ascending or descending.
Now notice here that I've got two rows that have the same value in the last name.
Naturally I would want to sort by first name as a secondary column.
Notice here it put somebody with the letter D above somebody with the letter C. So how
do we get this to correct itself?
Well, one simple way to do it is to sort by one column first and then another column because
Numbers will remember the order.
When you sort by a column if there's a tie it will put them in the order they were before.
So if I go and sort by first name you could see here Claire is now above Devin.
Now when I go and sort by last name and you could see these two are together but Claire
is first and Devin is second.
Another way to do it is to use the Full Sort Settings.
You could find those by going to Organize, and then Sort.
Here you could add multiple columns as criteria for a sort.
So let's start off by adding a column here.
Notice it gives me the names that are in the Header row here.
If I didn't have names here or I didn't have a Header row I would just see A, B, C, D,
etc.
But let's say we want to sort by last name first.
The last name is the priority.
We can set ascending or descending.
Now we could leave it at that or we could go and add another one right here.
First Name.
That's going to be the secondary column to sort.
We'll do that as ascending.
So now we click Sort Now and it will resort and do last name, first name.
If it already was that let's go and say sort by Score.
So I'll do Score Ascending and now you see they are out of order there.
Now if I were to do Sort Now it resorts everything and it has got these names in proper order.
So choosing one of these Quick Actions here doesn't change how your table would normally
be sorted.
You could always return to Organize, Sort and click Sort Now to resort everything.
You could also go to Organize and Apply Sort Rules or Shift Command R. Sometimes Sort Now
and Apply Sort Rules don't work.
For instance, if I do a sort by score then I selected a Heading there and I say Sort
Now, notice it doesn't do it.
But if I select a regular cell or no cell at all it would sort just fine.
So why doesn't it just sort automatically?
When you change somebody's last name why doesn't it just jump to the proper place.
Why do you have to click a button or use a keyboard shortcut to resort?
That's because if you're entering in data it can become very disorienting when you're
having a sort happen automatically.
So if I were entering in a new row, entering in the last name and it automatically jumped
that row to its proper place in the sort now I'm in a different place in the table.
I've finished entering in that record and now I have to go back to the end of the table
again to enter in a new row.
The same thing even when you're changing something.
You change somebody's score say and then it resorts everything and you're not in the same
spot anymore.
So the idea is to allow you to change things the table stays where it is until you take
an action to say resort it now.
You could go and change the order of the sort by dragging from this little point here in
each one of these.
You can alter them as much as you want.
You can use the Trashcan button to remove one of these.
You can continue to add more.
As many as you need.
You can also choose to sort the entire table for only rows that you've selected.
Now you may have noticed that when I went to Organize there are a couple of more sort
options here.
These apply if you have Categories turned on.
So let's do that.
Notice I have Team here, and there's teams 1, 2, and 3.
If I click here I can quickly apply a category by adding it right there, Add Category for
Team.
When I do that it groups everything by team.
So you see team 3, team 1, and team 2.
Why did it choose that order?
Because the first team mentioned was 3.
The next one mentioned was 1.
So maybe let's sort them by team number.
Now if you go to Organize notice Sort Groups is turned on.
We can access that and say Sort by Team Ascending.
What about this other option Sort Summaries.
Well the summaries are these cells here that appear to the right of each category here.
I could click in one and click this button here to add a function to calculate a number
for these.
For instance the total number in each category or a subtotal of those things or in this case,
since it's a score, let's do Average.
Now you can see for each one of these we get the average.
So this is the average for each group.
Now if we go to Organize and say Sort Summaries notice we can sort by the score here.
So let's sort by descending to get the top team.
We can also click here, say, and let's just get a count.
This tells us how many people are in each team.
Now we can go here and go Organize, Sort, By Count so we could see Team 1, 3, and 2;
4, 7, and 9 total members.
It's handy then to be able to collapse these groups like that and you could just see each
team, the total number of members, and the average for the team.
Handy if you have 5000 members and 7 teams.
You can quickly see all the teams without having to worry about seeing every member
listed under their team.
If you Option click on these little reveal triangles here it will reveal or Hide all
of the members of each group.
If I turn off Categories then you could see it puts everything back but it keeps that
same order so team 1 members are first.
Now sometimes it may be necessary to create a new column to sort by something.
Like let's say we wanted to sort by age of the members when they first joined.
So here we have their birthday and membership date.
Let's go and create a new column.
Add Column After is another Quick Action.
We can say Age When Joined.
We could just do a simple calculation here.
Membership date minus their birthday.
We get the number of days old they were when they first joined.
Select that and Select the whole column and paste it in here.
Now I can sort here, Age When Joined Ascending and we could seethe this member was the youngest
when they first joined.
Another way to do this is to use another function called YEARFRAC or fractional.
When we put that in there we could see we choose the start date, so the birthday, and
the end date, which would be their membership date, and the Day Basis would be the actual
number of years between those two dates.
Now we could see the number of years there.
I could Copy and Paste throughout.
Of course the Sort Order is the same but we could now see clearly the member joined when
they were only 15 years old and this member joined when they were 39 years old.
So there's a quick look at the basic sort functionality in Numbers.
Hope you found
this useful.