Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 125
Default Extract text in middle using Mid and Find or Search

Hi,

Here's the string I need to extract from: Regional Sales: SMITH, E.
(330146)
Here's what I want to end up with: SMITH
All the rows contain the same beginning (Regional Sales: ) (:space), it's
the length of the last name that varies, but all of the last names end with a
comma. I've been spinning my wheels, I know I'm close, but I just can't get
it. TIA :)
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,651
Default Extract text in middle using Mid and Find or Search

On Wed, 23 Jan 2008 06:38:09 -0800, Karin
wrote:

Hi,

Here's the string I need to extract from: Regional Sales: SMITH, E.
(330146)
Here's what I want to end up with: SMITH
All the rows contain the same beginning (Regional Sales: ) (:space), it's
the length of the last name that varies, but all of the last names end with a
comma. I've been spinning my wheels, I know I'm close, but I just can't get
it. TIA :)


Your precise description is commendable and makes formulating a solution
simple. Thank you for that.

=MID(A1,FIND(":",A1)+2,FIND(",",A1)-FIND(":",A1)-2)
--ron
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,646
Default Extract text in middle using Mid and Find or Search

=MID(A1,SEARCH(": ",A1)+2,SEARCH(",",A1)-SEARCH(": ",A1)-2)

Regards,
Stefi


€˛Karin€¯ ezt Ć*rta:

Hi,

Here's the string I need to extract from: Regional Sales: SMITH, E.
(330146)
Here's what I want to end up with: SMITH
All the rows contain the same beginning (Regional Sales: ) (:space), it's
the length of the last name that varies, but all of the last names end with a
comma. I've been spinning my wheels, I know I'm close, but I just can't get
it. TIA :)

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,718
Default Extract text in middle using Mid and Find or Search

Try this:

=MID(A1,17,FIND(",",A1)-17)


"Karin" wrote:

Hi,

Here's the string I need to extract from: Regional Sales: SMITH, E.
(330146)
Here's what I want to end up with: SMITH
All the rows contain the same beginning (Regional Sales: ) (:space), it's
the length of the last name that varies, but all of the last names end with a
comma. I've been spinning my wheels, I know I'm close, but I just can't get
it. TIA :)

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,651
Default Extract text in middle using Mid and Find or Search

=MID(A2,17,FIND(",",A2)-17)
--
David Biddulph

"Karin" wrote in message
...
Hi,

Here's the string I need to extract from: Regional Sales: SMITH, E.
(330146)
Here's what I want to end up with: SMITH
All the rows contain the same beginning (Regional Sales: ) (:space), it's
the length of the last name that varies, but all of the last names end
with a
comma. I've been spinning my wheels, I know I'm close, but I just can't
get
it. TIA :)





  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,646
Default Extract text in middle using Mid and Find or Search

I envy you for recognizing the simpler solution!
Stefi


€˛Teethless mama€¯ ezt Ć*rta:

Try this:

=MID(A1,17,FIND(",",A1)-17)


"Karin" wrote:

Hi,

Here's the string I need to extract from: Regional Sales: SMITH, E.
(330146)
Here's what I want to end up with: SMITH
All the rows contain the same beginning (Regional Sales: ) (:space), it's
the length of the last name that varies, but all of the last names end with a
comma. I've been spinning my wheels, I know I'm close, but I just can't get
it. TIA :)

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
How to extract text from middle of a string Makelei Excel Worksheet Functions 18 July 9th 08 09:03 PM
search or find, and extract? SusanInTexas Excel Discussion (Misc queries) 1 August 24th 07 10:20 PM
Extract Middle Initial from Name Dave Y Excel Worksheet Functions 10 July 11th 07 11:17 PM
Extract middle initial rocket0612 Excel Discussion (Misc queries) 4 July 5th 05 09:05 AM
Search/Extract Data w/in Text File D.Parker Excel Discussion (Misc queries) 4 June 21st 05 07:33 PM


All times are GMT +1. The time now is 06:09 AM.

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"