Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
NWO NWO is offline
external usenet poster
 
Posts: 60
Default Text string manipulation...

Hi.

Seems simple, but not for me...

I have a list of names in the format John N Jones (no commas). I want to
only capture the last name (i.e. Jones) in another cell. How do I accomplish
this. I already tried the Pearson site, but no help. No code please.

Thank you.

Mark
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,572
Default Text string manipulation...

With list of names starting in A1, try this in B1:

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

Copy down as needed.
--
HTH,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------
"NWO" wrote in message
...
Hi.

Seems simple, but not for me...

I have a list of names in the format John N Jones (no commas). I want to
only capture the last name (i.e. Jones) in another cell. How do I
accomplish
this. I already tried the Pearson site, but no help. No code please.

Thank you.

Mark



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
NWO NWO is offline
external usenet poster
 
Posts: 60
Default Text string manipulation...

Thank you. Can you please explain the use of the ^^^ symbols as used in your
function?

Thank you again.

Mark :)

"Ragdyer" wrote:

With list of names starting in A1, try this in B1:

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

Copy down as needed.
--
HTH,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------
"NWO" wrote in message
...
Hi.

Seems simple, but not for me...

I have a list of names in the format John N Jones (no commas). I want to
only capture the last name (i.e. Jones) in another cell. How do I
accomplish
this. I already tried the Pearson site, but no help. No code please.

Thank you.

Mark




  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,718
Default Text string manipulation...

Try this:

=MID(A1,FIND("~",SUBSTITUTE(A1," ","~",LEN(A1)-LEN(SUBSTITUTE(A1,"
",""))))+1,99)


"NWO" wrote:

Hi.

Seems simple, but not for me...

I have a list of names in the format John N Jones (no commas). I want to
only capture the last name (i.e. Jones) in another cell. How do I accomplish
this. I already tried the Pearson site, but no help. No code please.

Thank you.

Mark

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,268
Default Text string manipulation...

It's just a dummy, something that normally does not occur in a text string

this part

LEN(A1)-LEN(SUBSTITUTE(A1," ",""))

will count how many spaces there are in the string, using your example of

John N Jones

gives the result of 2, there are 2 spaces, one after the first name and one
after the initial, so the part of the formula above will return 2

substitute works as follows

string, old_text,new_text,occurrence, so the part that returns 2 is in
occurrence telling excel to substitute the last space with ^^^, then find
will find where it is counting from the left.

So if we replace the above formula with the result 2 it will look like

SUBSTITUTE(A1," ","^^^",2)

replace the second space with ^^^

then

FIND("^^^",SUBSTITUTE(A1," ","^^^",2))

will return the number of characters counted from the left where ^^^ is
located after we replaced the second space with it

that number is 7

LEN(A1)

will count the number of characters in A1

which is 12

so

=RIGHT(A1,12-5)

gives

=RIGHT(A1,5)

return the last 5 characters which is Jones



--

Regards,

Peo Sjoblom



"NWO" wrote in message
...
Thank you. Can you please explain the use of the ^^^ symbols as used in
your
function?

Thank you again.

Mark :)

"Ragdyer" wrote:

With list of names starting in A1, try this in B1:

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

Copy down as needed.
--
HTH,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------
"NWO" wrote in message
...
Hi.

Seems simple, but not for me...

I have a list of names in the format John N Jones (no commas). I want
to
only capture the last name (i.e. Jones) in another cell. How do I
accomplish
this. I already tried the Pearson site, but no help. No code please.

Thank you.

Mark






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
String Manipulation within VBA BillCPA Excel Discussion (Misc queries) 2 December 6th 06 05:29 PM
Text manipulation paulinoluciano Excel Worksheet Functions 5 April 18th 06 01:24 AM
Text manipulation paulinoluciano Excel Worksheet Functions 36 January 12th 06 09:54 AM
String Manipulation String Manipulation Excel Discussion (Misc queries) 3 November 30th 05 11:51 PM
text manipulation eenstudent Excel Worksheet Functions 5 July 13th 05 10:23 PM


All times are GMT +1. The time now is 07:42 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"