Extract Numbers from a String of Text

bobzy20

New Member
Joined
Feb 5, 2018
Messages
41
Office Version
  1. 2010
Hi

I hope somebody can help me with this.

I’m looking for a way to extract a 7 digit number from a string of text, see my examples below. The number could be anywhere in the string.

Sanyo Yamaha II Slow Control Rod NEW 5841258 25984
Sanyo 4579542 Yamaha II Slow Controller NEW 12584
Sanyo Yamaha II Plastic Bag NEW 1248652 25489
Sanyo Yamaha II 9405566 Tool Bag NEW / 5894526
Sanyo Yamaha II/Super Car 1257945 Screw Bag C NEW 25689
Sanyo Yamaha Metal Parts 1584520 Bag NEW 56974

Thanks

Bob
 
That is (partly) why I qualified my post with "IF the sample data was representative of the real data". All the sample data examples contained a 7-digit number surrounded by spaces & also no numbers greater than 7 digits. Your example is different to the OP's samples on the first point. :)


In that case, does this work? If not, could you give a more representative set of sample data and the expected results?

=MID(AGGREGATE(14,6,(9&MID(A1,ROW(INDIRECT("1:"&LEN(A1)-6)),7))+0,1),2,7)

Thanks, I will try and let you know.

Bob
 
Upvote 0

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
Works perfectly, thanks very much.

How many years have you been using Excel as all I really use is VLOOKUP!

Bob
 
Upvote 0

Forum statistics

Threads
1,215,563
Messages
6,125,565
Members
449,237
Latest member
Chase S

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