Creating formula for Check Digit following ten digit number

samual

New Member
Joined
Aug 2, 2007
Messages
2
Hello,

Our exact problem is this: We have a ten digit number, 6134217948, and we need to find a check digit for it. We have a manual formula which invovles multiplying every other number, i.e. 1,4,1,9,8, by two, and then adding the sum of the resulting numbers to the sum of the rest, i.e. 6,3,2,7,4. However if any of the first string of numbers multiplied by two is larger than 9, than it drops the tenths digit and has a one added to it.

For example 1 4 1 9 8 individually multiplied by 2 equals 2 8 2 18 16, which is changed to 2 8 2 9 7.

After this is said and done the two strings are added back together, ie (2+4+2+9+7)+(6+3+2+7+4) and the ones column of the resulting number is subtracted from ten to equal our check digit number.

While we can manage all of this manually, we need help making a formula to mass produce this in excel.

Any help would be very welcome,

Thank You.
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
Is this what you're looking for...

Code:
=10 - RIGHT(SUM(MOD(MID($A2,2,1)*2,10)+(--MID($A2,2,1)*2>9),MOD(MID($A2,4,1)*2,10)+(--MID($A2,4,1)*2>9),MOD(MID($A2,6,1)*2,10)+(--MID($A2,6,1)*2>9),MOD(MID($A2,8,1)*2,10)+(--MID($A2,8,1)*2>9),MOD(MID($A2,10,1)*2,10)+(--MID($A2,10,1)*2>9),--MID($A2,1,1),--MID($A2,3,1),--MID($A2,5,1),--MID($A2,7,1),--MID($A2,9,1)),1)
 
Upvote 0
put the upc on cell c4, then on cell d4 put this formula

=ROUNDUP((MID(C4,1,1)+MID(C4,3,1)+MID(C4,5,1)+MID(C4,7,1)+MID(C4,9,1)+MID(C4,11,1))*3+(MID(C4,2,1)+MID(C4,4,1)+MID(C4,6,1)+MID(C4,8,1)+MID(C4,10,1)),-1)-((MID(C4,1,1)+MID(C4,3,1)+MID(C4,5,1)+MID(C4,7,1)+MID(C4,9,1)+MID(C4,11,1))*3+(MID(C4,2,1)+MID(C4,4,1)+MID(C4,6,1)+MID(C4,8,1)+MID(C4,10,1)))

this will give you the check digit.

then on column e, you can put this formula to combine the two

=CONCATENATE(C4,D4)
 
Upvote 0
Enter a 10 digit nuber in a1 and try this in b1 to get your check digit

Here's my shot confirmed with Ctrl + Shift + Enter

Code:
=10-(RIGHT(SUM(IF(MID(A1,{2,4,6,8,10},1)*2>9,MOD(MID(A1,{2,4,6,8,10},1)*2,10)+1,MID(A1,{2,4,6,8,10},1)*2))+SUM(MID(A1,{1,3,5,7,9},1)+0),1)+0)
 
Upvote 0

Forum statistics

Threads
1,214,653
Messages
6,120,750
Members
448,989
Latest member
mariah3

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top