anybody understand UPC codes???
Posted by Kevin on November 26, 2001 1:58 PM
I need to set something up in excel to compute the checksum for a UPC code. A UPC code is 11 digits long with a twelfth digit that is the checksum. Here is how a checksum is calculated:
1. add up the 1st,3rd,5th,7th,9th,and 11th digits of the code.
2. multiply the result of step 1 by 3.
3. add up the 2nd,4th,6th,8th, and 10th digits of the code and add this to the product calculated in step 2.
4. the checksum is the SMALLEST number which, when added to the result of step 3, yields a number that is a multiple of ten.
OK, so there you have it. I have figured out a way to pull the digits from any given UPC code and add or multiply as directed above to achieve the desired result. Now I am stuck, because I cannot figure out a way for Excel to figure what number needs to be added to the figure computed above to achieve a number that is a multiple of ten.
Anyone out there know how I can do this?
Thanks,
Kevin