function to extract numbers

  • Thread starter Thread starter ela
  • Start date Start date
E

ela

13133..13558 (-)(426bp)
13714..13995 (-)(282bp)


match, exact, left, right, mid cannot help me extract the pairs of 13133,
13558; and 13714, 13995

is there any function rather than writing regular expression in VBscript (if
any) to achieve the purpose?
 
=LEFT(A1,5)
to extract 13133

and

=MID(A1,FIND(" (-)",A1,1)-5,5)
to extract 13558

HIH
 
hi ela

Have you tried
=Left(A1,find(".",A1)-1) to get 13133
and
=MID(A1,FIND(".",A1)+2),5) to get 13358

or, if you wanted them as a pair, comma separated, then
=SUBSTITUTE(LEFT(A1,FIND(" ",A1)-1),"..",",")
 
13133..13558 (-)(426bp)
13714..13995 (-)(282bp)


match, exact, left, right, mid cannot help me extract the pairs of 13133,
13558; and 13714, 13995

is there any function rather than writing regular expression in VBscript (if
any) to achieve the purpose?

Data/Text-to-Columns can split that up
Delimited
Select <space>
<other> . (enter a dot)
Treat consecutive delimiters as one

--ron
 

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

Back
Top