If you mean you have part numbers that are numerically 1, but are actual text values such as 0001 and 0000001, and are diffent part numbers, perhaps:
=SUMPRODUCT(--(B1:B1000="000001"),A1:A1000)
but if you want to do this for all your parts, why not a pivot table?