Removing Spaces Between Names

Fritz24

Board Regular
Joined
Sep 8, 2004
Messages
102
I have a data table that contains employee names. For some reason the source data my table comes from now contains a number of spaces between the firstname and surname of the employees. There is no way I can change this source data.

Is there any way I can replace all the incorrect names with correct ones?

For example:

John Smith = Correct
John____________________Smith = Incorrect (I had to use underscores to illustrate the point - it's spaces in my table)

The number of spaces between the names varies.

Thanks...
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
How about the following

CorrectName:Left([MyField], InStr([MyField], " ")) & Trim(Mid([MyField], InStr([MyField], " ")))

Replace MyField with the appropriate field name.
 
Upvote 0

Forum statistics

Threads
1,221,819
Messages
6,162,155
Members
451,749
Latest member
zack_ken

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