How To Sort a List Alphabetically In Pages

There is no built-in basic function to sort a list in Pages. But you can do it without leaving Pages by using a temporary table. You can also use Apple Intelligence to sort a list, often with more complex options.
You can also watch this video at YouTube.
Watch more videos about related subjects: Pages (226 videos).

Video Summary

In This Tutorial

Learn how to sort lists alphabetically in Pages using a workaround with tables, including handling names in different formats and trying Apple Intelligence as a quick alternative.

Sort Using a Temporary Table

Select the entire list (Command-A) and copy it (Command-C). Insert a plain table and paste the list into the first cell. Each line goes into a separate row. Use the column header's menu to sort ascending. To convert the sorted table back into text, select the entire column, merge the cells (Format > Table > Merge Cells), double-click to get a cursor inside, select all, copy, and paste back into the document. Delete the original list and table.

Consider Leaving the List As a Table

Keeping the list in table format lets you easily add, remove, or edit items and re-sort later. You can shrink the table to one column, adjust the width, and style it for appearance. This is useful for lists that change frequently.

Sorting Last Name, First Name Lists

Copy the list and paste it into a new table. Pages will auto-split names into two columns using the comma delimiter. Remove the comma delimiter using the prompt at the top of the table. You now have the list entirely in one column and can sort and merge cells as before to get a sorted list.

Sorting First Name Last Name Lists

Copy the list and paste into a new table. Use a formula in column B to extract the last name: =TEXTAFTER(A1," ",-1). Fill down column B. Sort by column A first, then column B to alphabetize by last name. Merge the A column cells, copy the result, and paste it back as plain text.

Sorting With Apple Intelligence

If supported on your Mac, you can select a list and go to Edit > Writing Tools > Show Writing Tools. Use the prompt to "sort this list alphabetically." This works for simple lists but results can be inconsistent, especially with complex names. You can also use Compose, which uses ChatGPT and can handle more complex instructions like sorting and reformatting names.

Video Transcript

Hi, this is Gary with MacMost.com. Let me show you how you can sort a list in Pages.
Now if you have a list of items in Pages you may want to sort it alphabetically. Unfortunately, there's no built-in way in Pages to sort a list like that. But you can do it by using third party apps copying the text out of Pages, sorting it and then pasting it back into Numbers. But I just want to show you ways that only involve using Pages. 
So let's say you've got a list like this. I can select the entire thing manually or since there's only a list in this document I'm going to  use Command A to select all of it. Now it would be great if there was just a menu item or button here that allowed me to sort. But there's not. So what I need to do to sort it is convert this to a table, which I can sort, and then convert it back to a regular text list like this. 
So I've got this copied now and I'm going to create a table. This is just temporary. I'm going to get rid of the table when I'm done. So, I'm going to put the cursor right there before the beginning of the first line and I can use this button here and then select the Plain table, like that, or I can also choose Insert and then Table and select Plain. Either one will get me this simple table here. Then I want to select the very first cell, A1. I just want to select the cell. I don't want to double click and then actually be editing the text in the cell. That's not what I want. So make sure you just have the cell selected and there is no blinking cursor. Now when I use Command V to paste you can see how it uses every line as a separate cell. So now I've got my Table here and I can Sort it. You can do that many different ways. I'm actually going to go up here to the column Header A and click on the little Context Menu button here and then choose Sort Ascending. It will resort these lines and you see they are now in alphabetical order. 
Now if I try to Copy & Paste this back into the regular body text it won't work. I can Command C to copy and let's say let's go down here and at the bottom I'll paste it in. You can see it's going to paste another copy of the table. Actually just the cells I selected. So instead what I want to do is I want to select all of the cells here in A. I can do that by double clicking on A, like that, and I want to choose Format and then Table, and then look for Merge Cells. That will merge all of the cells here into one cell. So every cell in the column is now a single line in this one cell. 
So now I do actually want to click inside here so I get a cursor there and select All with Command A. So I've selected all the text in the this cell and Command C to copy. Now I can go and paste that back into the body text. You can see I now have a copy of my list, but now it is sorted. I can now select and get rid of the original list, like that. I can also select this table here. An easy way to make sure you've selected the entire table, not just some cells in it, is to click on this handle and now I can press delete and delete the table. So now I'm left with just the sorted list. 
Although it is worth noting when you're at this stage where you have a table with every item in a different cell you may just want to keep it that way. You can click here on the right, this little circle at the right side, and reduce the number of columns to one. You can then select the right side here of column A and shrink that. Now you've got a table. You can select it here, go to Format and then Table, and then select a different style for it, or update the style yourself if you don't like this particular style. But the useful thing about a table is you can go back and resort it very easily. So you can add items, remove items, change items, and then resort it which may be more useful if you've got a document that evolves over time. You don't want to have to keep going through all those steps to alphabetize it. So keeping it as a table may be a good option for some. 
If you find these videos valuable consider joining the more than 2000 others that support MacMost at Patreon. You get exclusive content, course discounts, and more. You can read about it at macmost.com/patreon. 
Now one problem you may run into is if you have a list like this where there is a list of names, last name comma first name. If I try the same technique here watch what happens. I'm going to select All with Command A, Command C to copy. I'm going to insert a table here at the beginning, Table, and now I'll choose the Plain one like that. I'm going to paste all the names in. Look what happens. I get the last name in column A, the first name in column B. I get this right here: Table data was imported and can be adjusted. Click on that and you can see it selected a comma as a delimiter to divide up the two columns. I can remove the comma like this. I can click Update Table and now I get a table just like before with everything here in the first column. I can now sort it just like before. I can select Format, Table, Merge Cells. Double click in here. Use Command A, Command C to Copy All and then I can Paste it below to get a nice alphabetized list like before.
What about a situation where you have a list of names, first name and then the last name. How can you sort by last name? Well, let's give it a try. I'm going to use Command A, Command C to copy. I'm going to create a new table, plain like that, and I'm going to Paste into the table like that. So, now without any kind of comma or tab as an obvious delimiter it puts it all in the first column. That's fine. Let's extract the last name now by using a formula in the table. So I'm going to go to B1 here. I'm going to press the equals key to start typing a formula. Now I'm going to use the function Text After. So I'm going to select that here. The source string is going to be the name. So A1 there. It's going to search for a Space. So, double quote space double quote for that. The occurrence is going to be the last space, which is a negative 1. 1 will be the first space, 2 the second space, etc., but negative 1 means the first space from the end. So now when I use that you can see I get the last name here. I can Copy cell B1 and double click on B to select all these cells, and then Paste into B. So now I get the last name here as the second column. So the first thing I want to do is Sort By the first column. So now all the first names are alphabetical. Then I'm going to Sort By the second column. So it is going to resort it by last name but any ties would have retained the order that originally was there. So now we have all the names in Column A sorted alphabetically by last name. 
The only thing we have to worry about is every once in a while someone has a last name that does have a space in it. So you may have to treat those individually.
But right now I'm just going to double click Column A, choose Format, Table, Merge Cells. Now I get all the names in there again. Double click inside Command A, Command C all just like before and now I can Paste this new sorted list. Now I have them all sorted by last name here and I can delete everything above. 
Now is there any other way to do this just in Pages? There is but it doesn't work in all situations. If you have Apple Intelligence. So you've got a newer Mac that supports Apple Intelligence. You have it enabled and Apple Intelligence is supported in your region and with your language settings, then you can try to use Apple Intelligence for this. I'm going to select All here, or you would just select the list if it is not your entire document, and I'm going to go to Edit and then Writing Tools. You have all these tools like Proofread and Rewrite and all of that. But I want to do something custom. So I'm going to show Writing Tools here and I get a prompt. In the Prompt I'm going to tell it to sort this list alphabetically and Return. Instead of rewriting the whole list it is just going to sort it. It's not perfect in that you do end up with some odd things like spaces afterwards and everything like that. But I expect this to improve in the future. At least now it is a quick option that might work in some situations. 
Now when things get a little more complex sometimes Apple Intelligence doesn't get it quite right. For instance, I found that sometimes when I sort last name comma first name using Apple Intelligence by going to Writing Tools, Show Writing Tools, and then I would say Sort This List by last name. Sometimes it gets it right but I have seen it actually not sort it all correctly. In this case it seems to work pretty well. I would imagine if you've got some complex situations, like lots of last names that have spaces in them and middle names and things like that, that this may be a better option. You can also go to Edit, Writing Tools and then Compose. This will use ChatGPT instead of Apple Intelligence. So if Apple Intelligence isn't working, this may work better. Plus AI gives you some other options. Like, for instance, I can easily take this list here and, say, Sort By Last Name, then Convert to First Name, Last Name Format. Then it will do the sort and convert the format for me without having to mess with tables at all. I did get a little extra text as ChatGPT likes to be, well, chatty. 
So there's a few different ways to do it. Hope you found this useful. Thanks for watching. 

Comments: 7 Comments

    Roy Whelden
    1 month ago

    Learned so much from "How to Sort in Pages." Highly recommend it.

    Sheldon
    1 month ago

    Thanks bunches

    Robert Rutledge
    1 month ago

    Odd, when I tried to duplicate your process, it only worked when I removed the minus from the formula. Otherwise it came up blank rather than inserting the last name.

    Art Busbey
    1 month ago

    If a table is longer than a page in Pages then there is a chance you won't see the contents of the table extending beyond the first page. To fix this select the table and choose to Move With Text and then the table contents appear on all pages (at least in Word Processing mode). Also, if the table is long and you merge cells, it might look as though the table has gone blank, but this might be because the cell is formatted to center the text vertically rather than to move to the top of the cell.

    Stephen
    4 weeks ago

    There’s a way to sort a list in Pages using ChatGPT. Select your list. Right click. Select "Writing Tools". Then select "Show Writing Tools”. In the field at the top of the menu enter the word “sort”. In the popup menu select “ChatGPT”. You should get a panel that allows you to sort alphabetically in ascending or descending order and other options. I don’t claim it’s easier than using a table, but it may be more elegant.

    Stephen
    2 weeks ago

    Just wondering if Gary had a comment about sorting lists in Pages using ChatGPT, as I mentioned above.

    2 weeks ago

    Stephen: Seems to work OK. But I would double-check the results. I asked it to "sort" for some names and it worked. But when I asked it to sort a list of spelled-out numbers it failed. I had to specify "sort alphabetically" instead.

Leave a New Comment Related to "How To Sort a List Alphabetically In Pages"

:
:
:
0/500 (500 character limit -- please state your comment succinctly and do not try to get around this limit by posting two comments)