Filtering Numbers out of a Text String

Watson221

New Member
Joined
Jun 24, 2020
Messages
4
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
Hi Everyone,
I'm having some trouble extracting numbers from a string of text.
I need to get the information next to HP, so I thought I could use
=MID(D8,SEARCH({0,1,2,3,4,5,6,7,8,9},D8)-1, SEARCH("HP",D8)+2)

But It doesn't scale well as HP's position is different in different cells.

From this information I'd like to extract the number 30
30
HP 1800RPM 460/3/60 286 TSC H135-80539-0

From this info 15

MOTOR:AC;254T;15HP;3PH;460V;60HZ;1750RPM

From this info 100
PARTS KIT,CENT FAN,100 HP DRV,CLG

So I'm wondering if there's a way to ask Search to look for non-number values or an all together better way to accomplish this.
Thanks!
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
Hi & welcome to MrExcel.
How about
+Fluff New.xlsm
AB
1
230HP 1800RPM 460/3/60 286 TSC H135-80539-030
3MOTOR:AC;254T;15HP;3PH;460V;60HZ;1750RPM15
4PARTS KIT,CENT FAN,100 HP DRV,CLG100
Admin
Cell Formulas
RangeFormula
B2:B4B2=TRIM(RIGHT(SUBSTITUTE(SUBSTITUTE(LEFT(A2,SEARCH("hp",A2)-1),";",","),",",REPT(" ",100)),100))
 
Upvote 0
Wow Thanks! That scaled nicely to about 95% of the cells . Thanks, you saved me a ton of work.
Would you find breaking it down a bit and explaining why it works?
Thanks you so much!
 
Upvote 0
Can you post some examples of those that didn't work?
 
Upvote 0
Yeah no problem

An example would be this
Motor Toshiba 20HP,1750 RPM,460V,3PHASE,60HZ TEFC,Foot Mount,256T Frame Y 556.759
Would output as
Motor Toshiba 20

INPUT
FAN COIL UNIT - 40HP MOTOR
Output
FAN COIL UNIT - 40
 
Upvote 0
Ok, how about
=TRIM(RIGHT(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(TRIM(LEFT(A2,SEARCH("hp",A2)-1)),";",",")," ",","),",",REPT(" ",100)),100))
 
Upvote 0
Awesome thanks! That got it up to 99%! Only had to manually input around 10 out out of 2000! Thanks a ton!
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,215,045
Messages
6,122,840
Members
449,096
Latest member
Erald

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