Extract specific number from alphanumeric string

Gfletch63

New Member
Joined
Mar 2, 2018
Messages
6
Here is a sample string from a cell in my spreadsheet:

[TABLE="width: 197"]
<tbody>[TR]
[TD]PTG X 4 / 60 MINS UNLD

I need to grab the 60 out of that string. The word MIN or MINS is always to the right of the number, and the number is always either 2 or 3 digits.

Sounds like it should be simple, but...not for me. [/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
Hi, I initially started by using the MID function also, but encountered Errors if incase the User did not enter a Space before MIN:


Book1
ABCD
1PTG X 4 / 60MINS UNLD60#VALUE!
285 MINS UNLD ( 1 HR 25 MINS)8585
3185MINS UNLD ( 3 HR 5 MINS)185185
450 MINS UNLD5050
599MIN ABCD99#VALUE!
6DEL APPT / 29 MINS UNLD2929
Sheet7
Cell Formulas
RangeFormula
C1=RIGHT(TRIM(LEFT(A1,SEARCH("MIN",A1)-1)),3)+0
D1=MID(" "&A1,SEARCH("MIN"," "&A1)-4,4)+0
 
Last edited:
Upvote 0
Here is a modification to István's formula that appears to work...

=MID(" "&TRIM(SUBSTITUTE(A1,"MIN"," MIN")),SEARCH("MIN"," "&TRIM(SUBSTITUTE(A1,"MIN"," MIN")))-4,4)+0
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,183
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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