Extract String based on condition

G

Guest

How can I extraxt a string that begins with a certain number and is only X
amount of digits long?
Example: I need to extract where an "8" is found, and the next 6 spaces that
immediately follow:

fgte8575684vrdef - Resut should be 8575684

Any ideas? Thanks.
 
B

Bob Phillips

=MID(A1,Find("8",A1),8)

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Send Object Command - Two attachments"
 
R

RagDyer

Bob didn't really mean that.
What he really wanted to say was :

=MID(A1,FIND("8",A1),7)
 
D

Domenic

Try...

=IF(MID(A1,MIN(SEARCH({0,1,2,3,4,5,6,7,8,9},A1&"0123456789")),1)+0=8,MID(
A1,FIND(8,A1),7),"")

Hope this helps!

"Send Object Command - Two attachments"
 

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