Seperating last name and first name

nnadimi19

Board Regular
Joined
Jul 14, 2002
Messages
240
I have a column that has the last name and first name together. How do I go about creating two columns with the last name and first name seperately.

Please see the example.
html.xls
ABCDE
1LastNameFirstNameHonorarium
2Aronoff,Phillip,M.D.AronoffPhillipM.D.
3Myint,Christina,M.D.MyintChristinaM.D.
4Ramchandra,MahalakshmiRamchandraMahalakshmi
5Anderson,ViolaAndersonViola
6Iyer,HemalathaIyerHemalatha
7Konikowski,JanuszKonikowskiJanusz
8Le,HungLeHung
Sheet2
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
Hi,
Book2
ABCDE
1Last NameFirst NameHonorarium
2Aronoff, Phillip, M.D.AronoffPhillipM.D.
3Myint, Christina, M.D.MyintChristinaM.D.
4Ramchandra, MahalakshmiRamchandraMahalakshmi 
5Anderson, ViolaAndersonViola 
6Iyer, HemalathaIyerHemalatha 
7Konikowski, JanuszKonikowskiJanusz 
8Le, HungLeHung 
Sheet1


Formula in C2 and copied down,

=LEFT(A2,FIND(",",A2)-1)

In D2 and copied down,

=TRIM(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A2,C2,""),E2,""),",",""))

In E2 and copied down,

=IF(LEN(A2)-LEN(SUBSTITUTE(A2,",",""))>1,REPLACE(A2,1,LOOKUP(9.99999E+307,FIND(",",A2,ROW(INDEX(A:A,1):INDEX(A:A,LEN(A2)))))+1,""),"")

HTH
 
Upvote 0
Why not use Text to Columns from the Data menu? It looks like there is a comma and space between each section.
 
Upvote 0
Select C2 >> Insert >> Name >> Define

Defined workbook name : BreakString

Refer to Box, enter formula :

=EVALUATE("{"""&SUBSTITUTE($A2,",",""",""")&"""}")

C2 , enter formula and copied across to E2, then copied down :

=IF((COLUMN(A:A)=3)*(COLUMNS(BreakString)=2),"",INDEX(BreakString,COLUMN(A:A)-(COLUMNS(BreakString)=1)))
 
Upvote 0
Why not use Text to Columns from the Data menu? It looks like there is a comma and space between each section.

...... and then run the TRIM function to make sure all unwanted "spaces" are removed. :wink:
 
Upvote 0

Forum statistics

Threads
1,216,028
Messages
6,128,399
Members
449,447
Latest member
M V Arun

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