Lookup number in text string

retboell

New Member
Joined
Dec 17, 2018
Messages
3
Hi,

I'm searching for a solution to lookup and return the number of a cell/text string. Example:

[TABLE="class: grid, width: 330"]
<colgroup><col><col></colgroup><tbody>[TR]
[TD]Input[/TD]
[TD]Return[/TD]
[/TR]
[TR]
[TD]asd-1234567890123axbf[/TD]
[TD="align: right"]1234567890123[/TD]
[/TR]
[TR]
[TD]1234567890123_00sajs1[/TD]
[TD="align: right"]1234567890123[/TD]
[/TR]
[TR]
[TD]0-1234567890123sdfjquwe[/TD]
[TD="align: right"]1234567890123[/TD]
[/TR]
[TR]
[TD]asdasd-1-n1234567890123[/TD]
[TD="align: right"]1234567890123[/TD]
[/TR]
</tbody>[/TABLE]

The number will always start with 12345 (but the rest varies) and will always be 13 digits. Otherwise it can be mixed with other numbers and text in the cell (see example)

Help is much appreciated!
 
"hi-jacking" someone else thread!! no you are wrong, that was not the intention. I thought it is wrong to open a new thread when the topic we are discussing is about the code in this thread.
Anyway thanks for your suggestion.
 
Upvote 0

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
@lezawang
The topic of this thread was about extracting numbers from a string !
While you questions may relate to a post within that thread, they are not related to the topic as such.
Answering you first question is deemed ok, but by continuing the thread in another direction, ie, further questions about coding and not about extracting numbers from a string, is in fact, hijacking.
Not a pleasant term, but it detracts from the original question and then that user gets pushed into the background.
 
Upvote 0
Ok got it. Thanks for the clarification. I see the point now. Thank you.
 
Upvote 0

Forum statistics

Threads
1,223,243
Messages
6,170,967
Members
452,371
Latest member
Frana

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