Extract numerical values in multiple different text strings

Robarb

New Member
Joined
Oct 23, 2013
Messages
7
Hello all,

Going a bit mad with this one and I think the solution is simple but I seem to be having a brain melt.

I have a 2 columns with headers (Column A and B) of text strings (see image below).

In a third column (C) I would like to extract the Lowest number from the text string; this will generally be either the first number up to the "-" character, or the first number between the character "<" and the first "m" of mm.

In a fourth column (D) I would like to extract the Highest number from the text string; this will generally be either the only number between the character "<" and the first "m" of mm or the second number between "-" character and the first "m" of mm.

I've tried all the usual suspects with RIGHT, LEFT, MID, MIN, LEN, SEARCH, FIND, OR, SUMPRODUCT but can't seem to get the right combo or formula working properly. Any ideas?

I would really appreciate some clarity on this one. Thank you

1586280954415.png
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
How does the B column come into play?

Using the A column, C2 could be:
Code:
=IF(ISERROR(FIND("-",A2)),MID(A2,FIND("<",A2)+1,FIND("m",A2)),1*LEFT(A2,FIND("-",A2)-1))
filled down.
The D column could be:
Code:
=IF(ISERROR(FIND("-",A2)),1*MID(A2,FIND("<",A2)+1,FIND("m",A2)-FIND("<",A2)-1),1*MID(A2,FIND("-",A2)+1,FIND("m",A2)-FIND("-",A2)-1))
filled down.

Might not be the slickest way, but seems to do the trick.

(per your reply, change A to B in my column D code)
 
Last edited:
Upvote 0
Ah yes good point. So Column C should be the result of extraction from Column A, and Column D should be the result of the extraction from Column B.

Like this:

I have typed in the black numbers in this example, it would be good if i could get a formula to do it.

Thanks
1586282105194.png
 
Upvote 0
(per your reply, change A to B in my column D code)
 
Upvote 0
is that what you want?
LeftRightLowerHigher
100-200mm200-300mm100300
100-200mm300-400mm100400
<100mm100-200mm100200
<100mm200-300mm100300
100-200mm500-600mm100600
<100mm400-500mm100500
<100mm100-200mm100200
<100mm100-200mm100200
<100mm200-300mm100300
200-300mm800-900mm200900
<100mm100-200mm100200
<100mm300-400mm100400
<100mm300-400mm100400
100-200mm500-600mm100600
100-200mm300-400mm100400
<100mm100-200mm100200
<100mm100-200mm100200
<100mm<100mm100100
<100mm200-300mm100300
<100mm<100mm100100
100-200mm400-500mm100500
<100mm100-200mm100200
<100mm200-300mm100300
<100mm100-200mm100200
<100mm<100mm100100
<100mm300-400mm100400
700-800mm1000-1100mm7001100
 
Upvote 0

Forum statistics

Threads
1,214,652
Messages
6,120,746
Members
448,989
Latest member
mariah3

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