Microsoft Excel - Formula to extract all occurances of text string

Asked By Gauss on 17-May-16 08:29 AM
Hi Experts,

I have many rows with texts such as
absdgvc_233756182758getryrmnfg_233644986245iyhdtrbnn,
I want an Excel formula to extract all occurrences of 233 and nine numbers after 233, i.e. like above result to 233756182758 and  233644986245

thank you
Gauss
Harry Boughen replied to Gauss on 17-May-16 07:10 PM
Hello Gauss,

A couple of questions. 
Are the digit sequences that you want to extract always the only digits in the strings? 
In a given string, do the digit strings always start with the same digit sequence (eg 233 or 596 for instance)? 
Does it matter if the process is done in more than one cell?

Regards

Harry
Harry Boughen replied to Gauss on 17-May-16 07:52 PM
Hello Gauss,

For the given string, the following outputs the two numbers separated by a space in the one cell with your string in A.

=LEFT(RIGHT(A1,LEN(A1) - FIND("233",A1,FIND("233",A1))+1),12)&" "&LEFT(RIGHT(A1,LEN(A1) - FIND("233",A1,FIND("233",A1) + 12)+1),12)

Obviously, if you want to be able to change the search number sequence, you could replace "233" with a cell reference and put the search sequence in that cell.

Regards

Harry