The latest versions of Numbers make it much easier to sort by last name, even if the data includes only full names. The new functions TEXTBEFORE, TEXTAFTER and COUNTMATCHES allow you to put last name before the first name. You can also use REGEX to do it with an even shorter formula.
Want to know more about how to use Numbers on your Mac? Check out this MacMost course!
Comments: 6 Responses to “Last Name Sort In Mac Numbers”
David Chadderton
4 years ago
I'm sure I saw in the video when you showed the function help that you can use -1 in TEXTBEFORE and TEXTAFTER to select the last match, which would simplify your formula a bit as COUNTMATCHES would be unnecessary.
Gene: It has been around for years. I used it in the 1990s for desktop publishing when you want to keep two words together on the same line and for similar things.
Dan Bails
4 years ago
This is great Gary, You know almost everything, right? I have another wrench for my own list. I have a mixture of people's names and company names. I have tried putting the "fake space" in the company name but I get an error. Barn Yoga Group - "Argument 3 of TEXTAFTER is invalid." I guess your formula doesn't work if there are no spaces.
I'm sure I saw in the video when you showed the function help that you can use -1 in TEXTBEFORE and TEXTAFTER to select the last match, which would simplify your formula a bit as COUNTMATCHES would be unnecessary.
David: You're right!
Another fine video! How did you discover the "fake space" feature? That is option+space for Van Buren?
Gene: It has been around for years. I used it in the 1990s for desktop publishing when you want to keep two words together on the same line and for similar things.
This is great Gary, You know almost everything, right? I have another wrench for my own list. I have a mixture of people's names and company names. I have tried putting the "fake space" in the company name but I get an error. Barn Yoga Group - "Argument 3 of TEXTAFTER is invalid." I guess your formula doesn't work if there are no spaces.
Dan: Right, it needs a space to work. You can use IFERROR to just use the text as-is if you like.