Parsing the last name from a name string

D

Dan

I am using the Right function to extract the last name but
what nested function do you use to count the number of
characters in the last name?
 
K

Kevin Stecyk

Hi Dan,

Use LEN for length to determine the number of characters.

Regards,
Kevin
 
C

Carl Manaster

Hi, Dan,
I am using the Right function to extract the last name but
what nested function do you use to count the number of
characters in the last name?

I think this is what you're after:

=RIGHT(A1, LEN(A1)-SEARCH(" ",A1))

It assumes there is just one space in the name, so middle names or
initials, or titles in some names, etc., could be problematic. But
it's a start.

Peace,
--Carl
 
K

Katherine Coombs

LEN

eg =len("coombs") would return 6. Alternatively =LEN(A1) would also return
6 if coombs was in cell A1.

Cheers,
Katherine
 
J

J.E. McGimpsey

If you have only two names and they're separated by spaces,

=RIGHT(A1,LEN(A1)-FIND(" ",A1))

will return the second name. Or, with one fewer formula call:

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

Where 255 is just a sufficiently large number to capture text to the
right of the space.
 
H

Harlan Grove

...
...
=MID(A1,FIND(" ",A1)+1,255)

Where 255 is just a sufficiently large number to capture text to the
right of the space.
...

And if the arbitrary constant offends one's sensibility, there's always

=REPLACE(A1,1,FIND(" ",A1),"")

with the same number of function calls but the 1 here is less arbitrary than the
255 above. TMTOWTDI
 

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