Extracting certain numbers from a Cell

SAFMF

New Member
Joined
Sep 5, 2014
Messages
13
I am trying to extract the digits after the '-' in this type of data 236-1,46-2,jm007-6,893-2.

Any help would be appreciated.
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
Give this a try too:

=SUM(IFERROR(1*TRIM(MID(SUBSTITUTE(SUBSTITUTE(A1,"-",","),",",REPT(" ",99)),{1,3,5,7,9,11,13,15,17}*99,99)),0))


Thanks for this formula. i have been trying to adapt it so that i can use it on a similar all be it smaller string like this;

g1,b1,a1

what do I need to do to show a total of 3 for this example?

Your help is much appreciated



<tbody>
</tbody>
 
Upvote 0
XOR LX,

I prefer Yuengling Lager, Yuengling & Son is the oldest operating brewing company in the United States, established in 1829.

I have not had a chance to try Yorkshire ale. But, if I can find it - look out (y) (y)
 
Last edited:
Upvote 0
XOR LX,

I prefer Yuengling Lager, Yuengling & Son is the oldest operating brewing company in the United States, established in 1829.

I have not had a chance to try Yorkshire ale. But, if I can find it - look out (y) (y)

I was only kidding! Actually we've started to get some really good craft ales over from the States here in the last few years, and so I'll keep an eye out for your Yuengling & Son.

Cheers! (y)
 
Upvote 0
Thanks for this formula. i have been trying to adapt it so that i can use it on a similar all be it smaller string like this;

g1,b1,a1

what do I need to do to show a total of 3 for this example?

Your help is much appreciated

<tbody>
</tbody>

My solution was based on the position of „-„ and „,” so if the „-„ is missing you can not use my formula directly for the new sample. Trying to work out a formula for g1,b1,a1 (I think the other posters, too), still it would be a good idea to show all the samples you want the formula to work for.
 
Upvote 0
the examples in this case would vary in size as below.
d1,g1,b1,a1
g1,b1
g1,b1,a1

<tbody>
</tbody>


<tbody>
</tbody>

<tbody>
</tbody>
 
Upvote 0
Is there always only one digit?

Is the digit always "1" - your samples are.

Is there always only one letter before the digit(s)?

Make sure we have a good variety of data that fully represents the range of data you can have.
 
Upvote 0
No the digit can be a two, so could be b1,a2,c3,d1.; Yes there is only ever one letter before the digits
 
Upvote 0

Forum statistics

Threads
1,214,908
Messages
6,122,187
Members
449,071
Latest member
cdnMech

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top