How to chnage this 'jones, keith 41256' to 'Kieth Jones'

hey yer barred

Board Regular
Joined
Jun 19, 2007
Messages
232
Hi All!

I have over 500 names in a list and i need them in a normal name format...they currently look like this -

jones, keith 41256

I want them like this for reporting reasons

Keith Jones

On every name, there will always be a 5 digit number at the end and always a ',' sperating the last name from the first name.

Is there some sort of function in excel that will do this for me, as I really dont want to type all 500 names! :unsure: ...plus this will need changing as new people come and go all the time!

Many Thanks
Justin
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
If your data starts in A1, enter the following formula and drag down as far as necessary...

Code:
=MID(A1,FIND(", ",A1)+2,LEN(A1)-FIND(", ",A1)-7)&" "&LEFT(A1,FIND(", ",A1)-1)
 
Upvote 0
Hi
Paste the following codes in the macro window ( Alt F8)

Code:
Sub Names()
x = Cells(Rows.Count, 1).End(xlUp).Row
For a = 1 To x
d = Cells(a, 1)
b = InStr(Cells(a, 1), " ")
c = InStrRev(Cells(a, 1), " ")
Cells(a, 2) = Mid(d, b + 1, c - b - 1) & Left(d, b - 1)
Next a
End Sub
run the macro. It will rearrange the names into col B
ravi
 
Upvote 0
Try

Code:
=LEFT(REPLACE(A1,1,FIND(" ",A1),""),FIND(" ",REPLACE(A1,1,FIND(" ",A1),""))-1) & " " & LEFT(A1,FIND(",",A1)-1)
 
Upvote 0
Neil works fine for me too using it on a sheet of mine right now (",)
 
Upvote 0
Neil works fine for me too using it on a sheet of mine right now (",)
 
Upvote 0
If the original text has extra leading or trailing spaces, (or invisible characters), that would throw off some formulas.
 
Upvote 0

Forum statistics

Threads
1,214,632
Messages
6,120,655
Members
448,975
Latest member
sweeberry

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