[Solved] Sort a column of first and last names

Discuss the spreadsheet application
Post Reply
jimbokea
Posts: 193
Joined: Fri Jul 15, 2011 1:10 am

[Solved] Sort a column of first and last names

Post by jimbokea »

Can you sort say a christian names and surnames in a column by the surname without putting the surname first?
Last edited by MrProgrammer on Fri Feb 23, 2024 10:31 pm, edited 2 times in total.
Reason: Tagged ✓ [Solved] Q: Sort names without putting surname first? A: No -- MrProgrammer, forum moderator
OPenOffice 4.1.1 on Windows 7
User avatar
robleyd
Moderator
Posts: 5087
Joined: Mon Aug 19, 2013 3:47 am
Location: Murbko, Australia

Re: sorting in columns

Post by robleyd »

Not really, no.
Cheers
David
OS - Slackware 15 64 bit
Apache OpenOffice 4.1.15
LibreOffice 24.2.2.2; SlackBuild for 24.2.2 by Eric Hameleers
User avatar
floris v
Volunteer
Posts: 4431
Joined: Wed Nov 28, 2007 1:21 pm
Location: Netherlands

Re: Sort a column of names

Post by floris v »

An old trick, maybe not the best, is to use a helper column. Copy the list to a new column, select that column, then Data - Text to Columns..., tick Space as separator. That will give you several columns with christian names and hopefully one with surnames. Edit those to get a column with surnames. Now comes the tricky part. Move the surnames column next to your full names column, select both, then sort, using the surnames column as key.
 Edit: Inspired by Hagar's warning: There is no known algorithm that can tell the difference between christian names and surnames, or can tell which parts of a name with three or more elements are christian names and which ones are part of the surname. You will have to inspect each row with three or more name elements and combine surname elements of the surnames in a single cell before you can sort them. 
OpenOffice 4.1.11 on Ubuntu; LibreOffice 6.4 on Linux Mint, LibreOffice 7.6.2.1 on Ubuntu
If your problem has been solved or your question has been answered, please edit the first post in this thread and add [Solved] to the title bar.
Nederlandstalig forum
User avatar
Hagar Delest
Moderator
Posts: 32670
Joined: Sun Oct 07, 2007 9:07 pm
Location: France

Re: Sort a column of names

Post by Hagar Delest »

Beware of corner cases with the separator when there are names are surnames have spaces...
LibreOffice 7.6.2.1 on Xubuntu 23.10 and 7.6.4.1 portable on Windows 10
User avatar
Lupp
Volunteer
Posts: 3553
Joined: Sat May 31, 2014 7:05 pm
Location: München, Germany

Re: Sort a column of names

Post by Lupp »

Compound names are a mess from the beginning and should never be considered data.
See https://www.kalzumeus.com/2010/06/17/fa ... out-names/ 1. through 40. and the statements below.
(An exception could be if all your contacts have names of type John Doe that are syntactically separable by exactly one space.)
On Windows 10: LibreOffice 24.2 (new numbering) and older versions, PortableOpenOffice 4.1.7 and older, StarOffice 5.2
---
Lupp from München
Post Reply