Extract last name and first name, separated by comma (from full name with 3 or more names)

valmir

Active Member
Joined
Feb 10, 2021
Messages
267
Office Version
  1. 365
Platform
  1. Windows
Hi everyone:
I have found many posts about extracting the last name, first name and last and first, all from a full name with 2 names only. What if the full name has more than two names? Is there a formula that works for both full names with two names and full names with for example, 3, 4 or even more names?
If there is a way, I would like the name to be separated by a comma. Examples:
John Lauren Smith becomes Smith, John
Mary Scott becomes Scott, Mary
Paulo Teodoro Almeida da Silva becomes Silva, Paulo
Thanks!
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
Thanks a lot for the tip! So simple and I didn't even have an idea this feature existed! :)
 
Upvote 0
Hi Alan! I ran into a small problem. I have non adjacent columns so it looks like autofill only works for adjacent columns :(
 
Upvote 0
For those who may run into the same problem (auto complete or auto fill as suggested does not work for non adjacent columns, try this formula. (In this case, your source data is in cell A1):
=TRIM(PROPER(RIGHT(SUBSTITUTE(TRIM(A1);" ";REPT(" ";255));255)))&", "&TRIM(PROPER(LEFT(A1;SEARCH(" ";A1))))
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,326
Members
452,635
Latest member
laura12345

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top