ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Generate Check Digit (https://www.excelbanter.com/excel-programming/450546-generate-check-digit.html)

Benny123

Generate Check Digit
 
I need help generating a check digit for a 17 digit number using the Modulus 10 - weight 2 method. Rules below. 21212121212121212

(Modulus 10 – Weight 2)
The algorithm for calculating the check digit is as follows:
1. Working from right to left – multiply every other digit by two. Any carry, the “1” from any two digit product is added to the product of the next multiplication operation. If the product of the final multiplication operation is greater than nine, add the two digits of the product together and if there is a carry from the previous multiplication operation, add it to the sum of the two digits. (As illustrated in the example below for the first 9 in the ORGID: 9 x 2 = 18, 1+8 = 9, add the carry of 1 from the previous multiplication operation: 9 + 1 = 10.)
2. The digits in the products and the digits in the base number not multiplied by two are added together.
3. The total is subtracted from the next higher number ending in zero. If the total ends in zero, the number is subtracted from itself.
4. The difference is the check digit.
Example: ORGID = 9594567 Sequence # = 0123456789 Check Digit= ?
0. Base Number
95945670123456789

Answer - 8 for check digit. How can I do this for other 17 digit numbers?


All times are GMT +1. The time now is 04:14 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com