Pull info out of string

thepartydj

Board Regular
Joined
Sep 23, 2004
Messages
247
I have over a 100 lines like this....
Male Run Tee 10mm Tubexmale Bspt

They all are different numbers in front of the "mm".

Each string is a different length. I want to pull out the number in front and put into the next column. So in this case, the next column would show "10mm".

Thanks for your help.
 

Some videos you may like

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.

PaddyD

MrExcel MVP
Joined
May 1, 2002
Messages
14,234
assuming that none of the rest of the string is likely to have 'mm' in it:

=MID(A1,FIND("mm",A1)-2,4)

...would give you '10mm'.

FWIW, I'd use:

=--MID(A1,FIND("mm",A1)-2,2)

...to just return the number 10 (in case you want to kactually use the numbers as numbers (10), rather than have the text values ("10mm")
 

Watch MrExcel Video

Forum statistics

Threads
1,122,469
Messages
5,596,329
Members
414,055
Latest member
mcarduner

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
Top