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

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Because you are using 365, you can use Flash Fill. Here is a link to a tutorial

 
Upvote 0
Solution
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,224,824
Messages
6,181,187
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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