There is a logic in the three last examples, but not for A2? Please explain the logic
Hi
pecoflyer,
The logic is to split the data with delimiter "-" or "/" and extract the 1st group of alphanumeric or numeric value. Please see my formula solution.
I think this is not possible as the strings are different also the length of the Reference number is not unique.
The "Reference Number" could be extracted by >>
In C2, formula copied down :
=TRIM(LEFT(SUBSTITUTE(SUBSTITUTE(MID(A2,LOOKUP(99,FIND("/",SUBSTITUTE(LEFT(A2,MIN(FIND({0,1,2,3,4}+{0;5},A2&1/17))),"-","/"),ROW($1:$99)))+1,99),"-","/"),"/",REPT(" ",99)),99))
Or,
You could use this shorter formula, but it returned numeric value and removed all leading 0 >>
=FILTERXML("<a><b>"&SUBSTITUTE(SUBSTITUTE(A2,"-","/"),"/","</b><b>")&"</b></a>","//b[translate(.,'1234567890','')!=.][1]")