Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9
Default Extract parts of a cell

I have found several discussions on how to extract a first or last name, yet
I still need help on how to insert additional symbols as well...

I have in Cell A1: Mr. John Smith

I need in Cell B5: Mr. Smith:
and even, if I could get.... Dear Mr. Smith:

Can anyone offer some assistance? Thank you for your time.


  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,124
Default Extract parts of a cell

Will fail if you have initials Mr. John J. Smith

="Dear "&LEFT(C3,FIND(" ",C3))&RIGHT(C3,LEN(C3)-FIND(" ",C3,FIND(" ",C3)+1))

--
Don Guillett
SalesAid Software

"Aggies" wrote in message
...
I have found several discussions on how to extract a first or last name,
yet
I still need help on how to insert additional symbols as well...

I have in Cell A1: Mr. John Smith

I need in Cell B5: Mr. Smith:
and even, if I could get.... Dear Mr. Smith:

Can anyone offer some assistance? Thank you for your time.



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,311
Default Extract parts of a cell

One possible way:

="Dear " & D1 & RIGHT(A1,LEN(A1)-(FIND("^",SUBSTITUTE(A1,"
","^",LEN(A1)-LEN(SUBSTITUTE(A1," ","")))))) & ":"

HTH,
Paul


This will not work if there is a space in the last name. (ex. - Di Angelo)
"Aggies" wrote in message
...
I have found several discussions on how to extract a first or last name,
yet
I still need help on how to insert additional symbols as well...

I have in Cell A1: Mr. John Smith

I need in Cell B5: Mr. Smith:
and even, if I could get.... Dear Mr. Smith:

Can anyone offer some assistance? Thank you for your time.




  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,311
Default Extract parts of a cell

Ooops! I forgot to change D1. The correct formula should be:

="Dear " & LEFT(A1,FIND(".",A1)) & " " &
RIGHT(A1,LEN(A1)-(FIND("^",SUBSTITUTE(A1," ","^",LEN(A1)-LEN(SUBSTITUTE(A1,"
","")))))) & ":"

HTH,
Paul

"PCLIVE" wrote in message
...
One possible way:

="Dear " & D1 & RIGHT(A1,LEN(A1)-(FIND("^",SUBSTITUTE(A1,"
","^",LEN(A1)-LEN(SUBSTITUTE(A1," ","")))))) & ":"

HTH,
Paul


This will not work if there is a space in the last name. (ex. - Di Angelo)
"Aggies" wrote in message
...
I have found several discussions on how to extract a first or last name,
yet
I still need help on how to insert additional symbols as well...

I have in Cell A1: Mr. John Smith

I need in Cell B5: Mr. Smith:
and even, if I could get.... Dear Mr. Smith:

Can anyone offer some assistance? Thank you for your time.






  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9
Default Extract parts of a cell

Wow... these formulas are different from Access.... Thanks so much... it
worked..
--
Thank you for your time.
"Happiness is not having what you want, but wanting what you have"


"Don Guillett" wrote:

Will fail if you have initials Mr. John J. Smith

="Dear "&LEFT(C3,FIND(" ",C3))&RIGHT(C3,LEN(C3)-FIND(" ",C3,FIND(" ",C3)+1))

--
Don Guillett
SalesAid Software

"Aggies" wrote in message
...
I have found several discussions on how to extract a first or last name,
yet
I still need help on how to insert additional symbols as well...

I have in Cell A1: Mr. John Smith

I need in Cell B5: Mr. Smith:
and even, if I could get.... Dear Mr. Smith:

Can anyone offer some assistance? Thank you for your time.






  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9
Default Extract parts of a cell

Thanks so much... I was wondering how to add the colon... Yall are great.
--
Thank you for your time.
"Happiness is not having what you want, but wanting what you have"


"PCLIVE" wrote:

Ooops! I forgot to change D1. The correct formula should be:

="Dear " & LEFT(A1,FIND(".",A1)) & " " &
RIGHT(A1,LEN(A1)-(FIND("^",SUBSTITUTE(A1," ","^",LEN(A1)-LEN(SUBSTITUTE(A1,"
","")))))) & ":"

HTH,
Paul

"PCLIVE" wrote in message
...
One possible way:

="Dear " & D1 & RIGHT(A1,LEN(A1)-(FIND("^",SUBSTITUTE(A1,"
","^",LEN(A1)-LEN(SUBSTITUTE(A1," ","")))))) & ":"

HTH,
Paul


This will not work if there is a space in the last name. (ex. - Di Angelo)
"Aggies" wrote in message
...
I have found several discussions on how to extract a first or last name,
yet
I still need help on how to insert additional symbols as well...

I have in Cell A1: Mr. John Smith

I need in Cell B5: Mr. Smith:
and even, if I could get.... Dear Mr. Smith:

Can anyone offer some assistance? Thank you for your time.







  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,651
Default Extract parts of a cell

On Mon, 21 May 2007 13:21:01 -0700, Aggies
wrote:

I have found several discussions on how to extract a first or last name, yet
I still need help on how to insert additional symbols as well...

I have in Cell A1: Mr. John Smith

I need in Cell B5: Mr. Smith:
and even, if I could get.... Dear Mr. Smith:

Can anyone offer some assistance? Thank you for your time.


You can use Regular Expressions.

Although it can be implemented in VBA, it may be easier to download and install
Longre's free morefunc.xll add-in from http://xcell05.free.fr

Then use this formula:

=REGEX.SUBSTITUTE(A1,"(.*?\.).*?(\w+)$","Dear [1] [2]:")


--ron
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
Extract certain parts of string djDaemon Excel Worksheet Functions 3 February 2nd 06 07:42 PM
Extract certain parts of string djDaemon Excel Worksheet Functions 0 February 2nd 06 03:31 PM
How can I split one cell into two cell parts (upper & lower)? Desert Sparkle Excel Discussion (Misc queries) 0 January 5th 06 09:22 PM
hiding parts of a cell dick Excel Discussion (Misc queries) 3 October 17th 05 02:18 AM
hiding parts of a cell dick Excel Discussion (Misc queries) 0 October 17th 05 12:49 AM


All times are GMT +1. The time now is 01:44 PM.

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

About Us

"It's about Microsoft Excel"