Re-order Last Name/First Name in a Calc cell

I have a spreadsheet with over 500 names in a single column, formatted in the following manner: William Smith. I need to reverse the order these names appear and have the last name and first name separated by a comma. Re: Smith, William

What is the most effective way to accomplish this task?

Thanks

What should happen with Names like »Adam B. Turner« or »Toove van der Dike« ??

1 Like

The cells contain names beginning with the first name followed by middle name and last name. I need to reverse their entry so that the last name comes first, followed by first name then last name. The examples you have in your reply should appear like this: Turner, Adam B. - van der Dike, Toove. Not sure if “van der” is considered to be a middle name or if it is part of the surname. I am assuming it is part of the surname.

If you don’t know for sure, how can we manage it with simple pattern recognition?

1 Like

The majority of names (99%) will consist of a first name, middle name, and last name. Any devotion from that will be handled as an outlier and corrected manually.

no can do.

then :
image

…
image

⇒Find and replace

find: "^(.*?) (\w*['’-]?\w+)$" #without quotes
replace: $2, $1
[x] selection only
[x] regular Expression

⇒⇒ replace all

4 Likes

Thanks, that was what I was looking for. It worked perfectly.