Formula for Names

menor59

Well-known Member
Joined
Oct 3, 2008
Messages
574
Office Version
  1. 2021
Platform
  1. Windows
Hello Folks,

In My Work Book I have:

James Brown
Han Solo
Luke Skywalker

I need a formula that will make it :

Brown, James
Solo, Han
Skywalker, Luke

Your thought please and Thank you in advance
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
One way:
Code:
=MID(A1,FIND(" ",A1)+1,LEN(A1)) & ", " & LEFT(A1,FIND(" ",A1)-1)
 
Upvote 0
menor59,

And, another way:

If cell A2 contains the following:
James Brown

In cell B2 copy the following formula:
=TRIM(RIGHT(SUBSTITUTE(A2," ",REPT(" ",LEN(A2))),LEN(A2)))&", "&LEFT(A2,FIND(" ",A2)-1)

And, cell B2 will display the following:
Brown, James
 
Last edited:
Upvote 0
Hi,

Plenty of choices already for FIRST LAST name.

Assuming Only last word is LAST name, in case you have middle names and/or initials:


Book1
AB
1James BrownBrown, James
2Han SoloSolo, Han
3Luke SkywalkerSkywalker, Luke
4James T KirkKirk, James T
5Sarah Michelle GellarGellar, Sarah Michelle
Sheet123
Cell Formulas
RangeFormula
B1=TRIM(RIGHT(SUBSTITUTE(A1," ",REPT(" ",100)),100))&", "&TRIM(SUBSTITUTE(A1,TRIM(RIGHT(SUBSTITUTE(A1," ",REPT(" ",100)),100)),""))
 
Upvote 0
There's a non formula way also. Given your list in A, type the desired result of A1 in B1. Then select B1 and press Contol-E (Flash Fill). Excel will fill in the rest of the rows. If you have middle initials or multi-word names like jtakw showed, select one of the rows with the middle initial, put the desired result in column B (B4 or B5 in that example), then select B4 and press Control-E. Excel's pattern matching routines are often as good as a formula, but like formulas, they don't always get it right when there's something a little different.
 
Upvote 0

Forum statistics

Threads
1,215,036
Messages
6,122,794
Members
449,095
Latest member
m_smith_solihull

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