Extract data in a string

T

Tith

I've been scouring ths threads here, but can't quite find what I'm looking
for.
I am making a spread sheet with list of starndard parts. The Part name looks
like this: nas1101-04-08, nas1101-4-4, nas1101-04-4. I need to extract the
number between the dashes. I need to be able to tell the difference between
04, and 4
 
L

Lars-Åke Aspelin

I've been scouring ths threads here, but can't quite find what I'm looking
for.
I am making a spread sheet with list of starndard parts. The Part name looks
like this: nas1101-04-08, nas1101-4-4, nas1101-04-4. I need to extract the
number between the dashes. I need to be able to tell the difference between
04, and 4

If the first dash is always the fifth character of the part name you
can try this formula:

=LEFT(MID(A1,6,10),FIND("-",MID(A1,6,10))-1)

Hope this helps / Lars-Åke
 
C

Cordell

This seems a little cumbersome, but works.

=MID(A1,FIND("-",A1)+1,FIND("-",A1,FIND("-",A1)+1)-FIND("-",A1)-1)
 
T

Tith

This works great the way I got it to work was very clumbersome. I like your
shorter version. Thanks a lot.
 

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