Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
maryj
 
Posts: n/a
Default extracting last name

I have names of individuals in Column A. Some have only first and last,
others also include the middle initial. I want to extract the last name of
each person into Column B. I used the formula =RIGHT(A1,LEN(A1)-SEARCH("
",A1)) which works great for those names that don't include the middle
initial. How can I modify this to work for either situation? Thanks!!!
--
maryj
  #2   Report Post  
N Harkawat
 
Posts: n/a
Default

=MID(A1,LOOKUP(2,1/(MID(" "&A1,ROW(INDIRECT("1:1024")),1)="
"),ROW(INDIRECT("1:1024"))),1024)

"maryj" wrote in message
...
I have names of individuals in Column A. Some have only first and last,
others also include the middle initial. I want to extract the last name of
each person into Column B. I used the formula =RIGHT(A1,LEN(A1)-SEARCH("
",A1)) which works great for those names that don't include the middle
initial. How can I modify this to work for either situation? Thanks!!!
--
maryj



  #3   Report Post  
Ron de Bruin
 
Posts: n/a
Default

Try this with the nhame in D2

=IF(ISERR(FIND(" ",D2)),D2,MID(D2,FIND("^^",SUBSTITUTE(D2," ","^^",LEN(D2)-LEN(SUBSTITUTE(D2," ",""))))+1,1024))

--
Regards Ron de Bruin
http://www.rondebruin.nl


"maryj" wrote in message ...
I have names of individuals in Column A. Some have only first and last,
others also include the middle initial. I want to extract the last name of
each person into Column B. I used the formula =RIGHT(A1,LEN(A1)-SEARCH("
",A1)) which works great for those names that don't include the middle
initial. How can I modify this to work for either situation? Thanks!!!
--
maryj



  #4   Report Post  
Domenic
 
Posts: n/a
Default

Try...

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

Hope this helps!

In article ,
"maryj" wrote:

I have names of individuals in Column A. Some have only first and last,
others also include the middle initial. I want to extract the last name of
each person into Column B. I used the formula =RIGHT(A1,LEN(A1)-SEARCH("
",A1)) which works great for those names that don't include the middle
initial. How can I modify this to work for either situation? Thanks!!!

  #5   Report Post  
maryj
 
Posts: n/a
Default

Thanks Ron - that worked! Can you explain what the ^^ mean and why the 1024
at the end?
--
maryj


"Ron de Bruin" wrote:

Try this with the nhame in D2

=IF(ISERR(FIND(" ",D2)),D2,MID(D2,FIND("^^",SUBSTITUTE(D2," ","^^",LEN(D2)-LEN(SUBSTITUTE(D2," ",""))))+1,1024))

--
Regards Ron de Bruin
http://www.rondebruin.nl


"maryj" wrote in message ...
I have names of individuals in Column A. Some have only first and last,
others also include the middle initial. I want to extract the last name of
each person into Column B. I used the formula =RIGHT(A1,LEN(A1)-SEARCH("
",A1)) which works great for those names that don't include the middle
initial. How can I modify this to work for either situation? Thanks!!!
--
maryj




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
Extracting info from word and displaying in an excel spreadsheet Drew Excel Discussion (Misc queries) 0 March 7th 05 03:49 AM
Extracting File Names and Properties Albacore33 Excel Worksheet Functions 3 February 10th 05 03:23 PM
Extracting data from other columns Polar Excel Worksheet Functions 0 February 10th 05 12:07 PM
Extracting a value from between brackets James Excel Discussion (Misc queries) 3 February 5th 05 02:28 AM
Extracting Values on one list and not another B Schwarz Excel Discussion (Misc queries) 4 January 7th 05 01:48 PM


All times are GMT +1. The time now is 08:31 PM.

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"