Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,393
Default How do I parse cell contents to break out Last Name.

Taken from: http://www.ozgrid.com/Excel/extract-words.htm :
----------------------

Get Last Word From Text String. See Also: Extract Last Word VBA

Text Sting in A2 is;
Our main business focus is Excel Spreadsheets

Formula/Function is;
=MID(SUBSTITUTE(A2," ","^",LEN(A2)-LEN(SUBSTITUTE(A2,"
",""))),FIND("^",SUBSTITUTE(A2," ","^",LEN(A2)-LEN(SUBSTITUTE(A2,"
",""))))+1,256)
Formula/Function result is;
Spreadsheets
---------------------------

Of course, those with Jr and the like at the end will be a problem

best wishes
--
Bernard V Liengme
www.stfx.ca/people/bliengme
remove caps from email

"QDZF" wrote in message
...
I have one cell that contains first name(s) and last name. I want to break
the last name out and use the remaining data for first name. I can't do a
simple text to column because the column has data like:

John Smith
Joe & Jane Doe Jr.
Paul P Smith

I thought an easy way to do this would be to use a formula that would
(going
from the right) give me the text until it hits a space. I could then
count
the length of the parsed data and back that off of the origianl cell to
get
first and last name columns. I think this would work but it's not ideal.
Is
there a better solution?



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
Parse cell contents to new columns Frank Pytel Excel Worksheet Functions 6 March 8th 09 04:39 PM
Parse cell value based on contents Craig860 Excel Discussion (Misc queries) 7 September 24th 08 01:31 PM
parse cell contents [email protected] Excel Programming 22 September 27th 06 09:20 PM
Parse cell contents ? Fullam Excel Discussion (Misc queries) 4 May 3rd 06 06:14 PM
Parse contents of cell Portuga Excel Discussion (Misc queries) 4 March 28th 06 03:44 PM


All times are GMT +1. The time now is 10:38 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"