A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Worksheet Functions
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Finding last name in a first last name string



 
 
Thread Tools Display Modes
  #1  
Old March 31st, 2004, 09:11 PM
Brian Bonner
external usenet poster
 
Posts: n/a
Default Finding last name in a first last name string

I have a name field that contains first middle lastname. I want to extract the lastname and put it in another column. I think what I need is a function to return everything on the right hand side of the field from the end back to the first space. Can't seem to find the correct function. Any clues?
  #2  
Old March 31st, 2004, 09:15 PM
RagDyer
external usenet poster
 
Posts: n/a
Default Finding last name in a first last name string

Try this:

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

HTH,

RD
==============================================
Please keep all correspondence within the Group, so all may benefit!
==============================================


"Brian Bonner" wrote in message
...
I have a name field that contains first middle lastname. I want to extract
the lastname and put it in another column. I think what I need is a function
to return everything on the right hand side of the field from the end back
to the first space. Can't seem to find the correct function. Any clues?



  #3  
Old March 31st, 2004, 09:20 PM
Frank Kabel
external usenet poster
 
Posts: n/a
Default Finding last name in a first last name string

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

also have a look at
http://www.cpearson.com/excel/FirstLast.htm


--
Regards
Frank Kabel
Frankfurt, Germany


Brian Bonner wrote:
I have a name field that contains first middle lastname. I want to
extract the lastname and put it in another column. I think what I
need is a function to return everything on the right hand side of the
field from the end back to the first space. Can't seem to find the
correct function. Any clues?


  #4  
Old March 31st, 2004, 09:41 PM
Brian Bonner
external usenet poster
 
Posts: n/a
Default Finding last name in a first last name string

Thanks for your reply. The function works if the field contains only firstname lastname. Unfortunately the field may contain firstname middlename and firstname middlename lastname so it has to find the very last space in the string and then consider what follows the lastname. I will check out the cpearson site as well.
  #5  
Old March 31st, 2004, 09:41 PM
Frank Kabel
external usenet poster
 
Posts: n/a
Default Finding last name in a first last name string

Hi
sorry forgot your middle name. Try
=MID(A1,FIND(" ",A1,FIND(" ",A1)+1)+1,255)


--
Regards
Frank Kabel
Frankfurt, Germany


Frank Kabel wrote:
Hi
try
=MID(A1,FIND(" ",A1)+1,255)

also have a look at
http://www.cpearson.com/excel/FirstLast.htm



Brian Bonner wrote:
I have a name field that contains first middle lastname. I want to
extract the lastname and put it in another column. I think what I
need is a function to return everything on the right hand side of

the
field from the end back to the first space. Can't seem to find the
correct function. Any clues?


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 08:54 AM.


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