Hi,
did you try the simplest way using the LEFT function?
The formula =LEFT(VLOOKUP(A7,B1:E4,1,0),2) where A7 is the lookup value (e.g. 15a) and the range B1:E4 contain the data (starting with struct codes: 15, 15a, 15*, 15_ etc), should return you always 15 as code.
Does it make sense to...