Hi,
I have a cell called "Product Code" and I want to use this to generate a barcode in a cell called "Barcode" without using any other cells.
So, the "Barcode" cell would contain the company prefix, product code and the check digit e.g. "5054492" "22115" "8" (final format should be 5054492221158).
The formula would be something like: 5054492 (concatenate) "Product Code" (concatenate) "check digit algorithm".
The algorithm to generate the check digit is below.
Locate the 12th digit in the barcode.
For example, if your EAN-13 was 5054492 22115 x, the 12th digit is the No. 5.
Starting with this 12th digit, move from right to left across the code adding every second digit to it. Using our example code of 5054492 22115 x, this means starting with the No. 5 and adding to it the numbers 1, 2, 9, 4 and 0, giving a total of 21.
Multiply the sum obtained in Step 2 by 3. Using our example above, this means the multiplying of 21 by 3, giving a total of 63.
Locate the 11th digit in the code. Using our example code of 5054492 22115 x, this would be the No. 1.
Starting with the 11th digit, move from right to left across the code adding every second digit to it. Using our example of 5054492 22115 x, this means starting with the No. 1 and adding to it 2, 2, 4, 5 and 5, giving a total of 19.
Add the results from Step 3 and Step 5. In our example this means adding 63 and 19, giving a total of 82.
Round the result of Step 6 up to the nearest multiple of 10. In our example, this means rounding 82 up to 90.
Subtract the result of Step 7 from the result of Step 6. In our example, this is 90-82, giving us a difference of 8. This 8 should be the 13th number in the EAN-13, otherwise known as the check digit.
Result: 5054492 22115 8
Thanks
Bookmarks