Extract First Name Last name

patneel

New Member
Joined
Jan 19, 2010
Messages
4
Hi,

I have data stored as Last Name, First name but I want to get it now First Name Last Name (no comma)

Example-
Data-
Ho, Joseph zu-sien

Required Result-
Joseph zu-sien Ho


Also the lenghth of each name would be different so can not use fixed number to get required result.


Appreciate any help..
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
Hi,

I have data stored as Last Name, First name but I want to get it now First Name Last Name (no comma)

Example-
Data-
Ho, Joseph zu-sien

Required Result-
Joseph zu-sien Ho


Also the lenghth of each name would be different so can not use fixed number to get required result.


Appreciate any help..

If comma after the last name is a structural feature with all entries...

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

where A2 houses a name entry.
 
Upvote 0
If comma after the last name is a structural feature with all entries...

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

where A2 houses a name entry.

I think you need to change your formula to this so that it will not return the name with a leading space in front of it...

=REPLACE(A2,1,FIND(",",A2)+1,"")&" "&LEFT(A2,FIND(",",A2)-1)
 
Upvote 0
If there is always a space after the comma...

=MID(A1&" "&A1,FIND(",",A1)+2,LEN(A1)-1)

otherwise...

=TRIM(MID(A1&" "&A1,FIND(",",A1)+1,LEN(A1)))
 
Upvote 0
I think you need to change your formula to this so that it will not return the name with a leading space in front of it...

=REPLACE(A2,1,FIND(",",A2)+1,"")&" "&LEFT(A2,FIND(",",A2)-1)
Better:

=TRIM(REPLACE(A2,1,FIND(",",A2),"")&" "&LEFT(A2,FIND(",",A2)-1))
Just out of curiosity, why do you consider adding an additional function call to the formula as being better than simply adding one to the result from the existing FIND function?
 
Upvote 0
Just out of curiosity, why do you consider adding an additional function call to the formula as being better than simply adding one to the result from the existing FIND function?

Is this really worth discussing for there can be 0 to N spaces around the parts of the names and/or nothing after the comma? The +1 bit after FIND within REPLACE won't work as you may guess.
 
Upvote 0

Forum statistics

Threads
1,222,827
Messages
6,168,482
Members
452,192
Latest member
FengXue

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