There are duplictes in your code prefixes ALT appears three times, I have assumed the first in the list to be correct.
Some items on the part description list have no prefix allocated these show as #N/A in Column G on sheet "Cost_BOM_417981G1_Prod" where I have put this formula
In G2
=INDEX(CodeList,MATCH(LEFT(C2,FIND(" ",C2,1)-1),Component,0),1)&A2
Drag/Fill Down
CodeList & Component are two dynamic named lists I have put in a new sheet "Lookups"
Add and correct the prefixes and codes in this sheet columns D & E, the rest is just to show you the anomalies and should be deleted.
Hope this helps.
Bookmarks