Split contents of a cell

K

Kagsy

Dear All

I have been given a spreadsheet that has the full name of people in one
cell, e.g. Kagsy Malone. A combination of what functions would enable me to
parse the cell into the two component parts Kagsy & Malone.

In Access I could use:

[Names] = "Kagsy Malone" Kagsy
FirstName: Left([Names],InStr(1,[Names]," ")-1)

or

[Names] = "Kagsy Malone" Malone
LastName: Right(Trim([Names]),Len(Trim([Names]))-InStr(1,[Names]," "))

Thanks for the help...

Kagsy
 
K

Kagsy

Frank

Thanks for the info,

It was easier for me in Access. Afterall why not have an Instr function in
Excel as well!?

Thanks again.

Kagsy


Frank Kabel said:
Hi
have a look at
http://www.cpearson.com/excel/FirstLast.htm

you can use quite similar functions in Excel:
=LEFT(A1,FIND(" ",A1)-1)
if cell A1 stores your name

or
=TRIM(MID(A1,FIND(" ",A1)+1,255))

--
Regards
Frank Kabel
Frankfurt, Germany
Kagsy said:
Dear All

I have been given a spreadsheet that has the full name of people in one
cell, e.g. Kagsy Malone. A combination of what functions would enable me to
parse the cell into the two component parts Kagsy & Malone.

In Access I could use:

[Names] = "Kagsy Malone" Kagsy
FirstName: Left([Names],InStr(1,[Names]," ")-1)

or

[Names] = "Kagsy Malone" Malone
LastName: Right(Trim([Names]),Len(Trim([Names]))-InStr(1,[Names]," "))

Thanks for the help...

Kagsy
 
F

Frank Kabel

Hi
FIND/SEARCH do soemthing simila. You have an inStr function in VBA. I
have to look at MS Access what the difference between InStr and FIND
exactly is but for most cases you may use FIND without any problems :)

--
Regards
Frank Kabel
Frankfurt, Germany
Frank

Thanks for the info,

It was easier for me in Access. Afterall why not have an Instr
function in Excel as well!?

Thanks again.

Kagsy


Frank Kabel said:
Hi
have a look at
http://www.cpearson.com/excel/FirstLast.htm

you can use quite similar functions in Excel:
=LEFT(A1,FIND(" ",A1)-1)
if cell A1 stores your name

or
=TRIM(MID(A1,FIND(" ",A1)+1,255))

--
Regards
Frank Kabel
Frankfurt, Germany
Kagsy said:
Dear All

I have been given a spreadsheet that has the full name of people in
one cell, e.g. Kagsy Malone. A combination of what functions would
enable me to parse the cell into the two component parts Kagsy &
Malone.

In Access I could use:

[Names] = "Kagsy Malone" Kagsy
FirstName: Left([Names],InStr(1,[Names]," ")-1)

or

[Names] = "Kagsy Malone" Malone
LastName: Right(Trim([Names]),Len(Trim([Names]))-InStr(1,[Names],"
"))

Thanks for the help...

Kagsy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top