Extract text in middle using Mid and Find or Search

K

Karin

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 :)
 
R

Ron Rosenfeld

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
 
S

Stefi

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

Regards,
Stefi


„Karin†ezt írta:
 
S

Stefi

I envy you for recognizing the simpler solution!
Stefi


„Teethless mama†ezt írta:
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top