TRIM spaces

J

jh

I have first name and last name in one cell. Between the
first name and last name, there is a space. I want to put
the first name in one cell and the last name in another
cell. Is TRIM the right function to use? If not, how
would I accomplish this?

Thanks in advance.
 
R

Ragdyer

Select the column with the names, then

<Data> <TextToColumns>
Make sure "Delimited" is checked, then <Next>,
Put a check in "Space", then <Finish>.
 
M

Max

One way:

Assuming there's only 2 parts to the names in col A, A1 down
(First names and Last names only)

Put in B1: =LEFT(TRIM(A1),SEARCH(" ",TRIM(A1))-1)
Put in C1: =MID(TRIM(A1),SEARCH(" ",TRIM(A1))+1,99)

(the "99" in C1's formula is an arbitrary number, but should be sufficient.
Adjust by increasing this number to one higher if necessary)

Select B1:C1, and copy down

Col B will return the 1st part and col C the 2nd part

Example: If col A contains

Ben Rag
Jane Higgs
Joe Gymars

col B returns:
Ben
Jane
Joe

col C returns:
Rag
Higgs
Gymars
 
M

Max

One way:

Assuming there's only 2 parts to the names in col A, A1 down
(First names and Last names only)

Put in B1: =LEFT(TRIM(A1),SEARCH(" ",TRIM(A1))-1)
Put in C1: =MID(TRIM(A1),SEARCH(" ",TRIM(A1))+1,99)

(the "99" in C1's formula is an arbitrary number, but should be sufficient.
Adjust by increasing this number to one higher if necessary)

Select B1:C1, and copy down

Col B will return the 1st part and col C the 2nd part

Example: If col A contains

Ben Rag
Jane Higgs
Joe Gymars

col B returns:
Ben
Jane
Joe

col C returns:
Rag
Higgs
Gymars
 
J

jh

Thanks so much. This worked like a cham!

Ragdyer said:
Select the column with the names, then

<Data> <TextToColumns>
Make sure "Delimited" is checked, then <Next>,
Put a check in "Space", then <Finish>.
 
Top