How do I split a Text with no well defined delimiter

Abdmujib

Board Regular
Joined
May 15, 2022
Messages
123
Office Version
  1. 2021
Platform
  1. Windows
I have some text strings with no well defined delimiter except for the last strings are digit, I want to extract the digits from texts.
1729596792848.png

Thank you

NB: Excel 2021
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Based on that example, something like this:

Excel Formula:
=-LOOKUP(1,-RIGHT(B2,{1,2,3,4,5,6,7,8,9,10}))

which assumes the numbers are 10 digits or less.
 
Upvote 0
Solution
Another option:

Excel Formula:
=LET(
a,A1,
b,--(MID(a,SEQUENCE(LEN(a)),1)),
c,FILTER(b,ISNUMBER(b)),
--(CONCAT(c)))
 
Upvote 0
How about
Excel Formula:
=MID(B2,MIN(FIND(SEQUENCE(10,,0),B2&SEQUENCE(10,,0))),100)
 
Upvote 0
To answer the question you sent me privately:
Let's assume B2 contains Chalon/Saone8395
The RIGHT(B2,{1,2,3,4,5,6,7,8,9,10}) part of the formula returns an array of the last 1, 2... and so on characters of the text:
5
95
395
8395
e8395
ne8395
one8395
aone8395
Saone8395
/Saone8395

Negating those with - will return either a negative number or an error:

-5
-95
-395
-8395
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!
#VALUE!

LOOKUP does two things:
1. It ignores errors, so all those #VALUE! items will simply be ignored.
2. It assumes the data is sorted in ascending order and will return the last value that is less than or equal to the lookup value. Since all the values are negative, they are all less than 1 (which is why using any other positive number will also work). So in this case it returns -8395

The - sign before the LOOKUP then converts that negative number back to a positive: 8395
 
Upvote 0

Forum statistics

Threads
1,223,889
Messages
6,175,226
Members
452,620
Latest member
dsubash

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