Check Digit Mod 10 with weights 7-5-3-2

fastmr291

New Member
Joined
Jun 18, 2014
Messages
4
I need to create a check digit for a financial institution's scanline and am not quite sure how to make that happen using the 7532 weights. The appeal code and package code should be static so I will just assign the appropriate numbers for the letters and will build one string containing all of the numbers for the scanline without spaces. That is unless I should do it a different way. I found some VB code but I am unsure how to use it so if we can get everything to work in Excel or Access that would be wonderful. Thank you for your assistance and I await your responses.

~Chris


The instructions I received are as follows...

Total # of characters: 34
Font: OCR-A


The scan line is 34 characters long including all spaces. It is as follows:

POSITIONS START-END LENGTH DESCRIPTION
1-10 10 ID#1
11 1 Space
12-17 6 Fund2
18 1 Space
19-24 6 Appeal3
25 1 Space
26-32 7 Package4
33 1 Space
34 1 Check Digit Verifier5


1 – ID# - all ID#’s from the client should be 10 characters

2 – Fund - always 451000

3 – Appeal – DM# - 0 fill after DM if necessary (ie DM0213)

4 – Package – Keycode (ie 405R914)

5 – Check digit (for whole scan line)



Alpha Conversion

Numeric Value
Alpha Value
1
A
J
S
2
B
K
T
3
C
L
U
4
D
M
V
5
E
N
W
6
F
O
X
7
G
P
Y
8
H
Q
Z
9
I
R


<tbody>
</tbody>




































<tbody>
</tbody>
Check Digit (CD) Routine – client required calculation


1. Identify the series of numbers
Ex. 1000108030 451000 DM0213 405R914

2. Convert any alpha characters to a number based on the conversion chart above

1
0
0
0
1
0
8
0
3
0
4
5
1
0
0
0
D
M
0
2
1
3
4
0
5
R
9
1
4
1
0
0
0
1
0
8
0
3
0
4
5
1
0
0
0
4
4
0
2
1
3
4
0
5
9
9
1
4

<tbody>
</tbody>

3. Assign weights from left to right 7,5,3,2

1
0
0
0
1
0
8
0
3
0
4
5
1
0
0
0
4
4
0
2
1
3
4
0
5
9
9
1
4
7
5
3
2
7
5
3
2
7
5
3
2
7
5
3
2
7
5
3
2
7
5
3
2
7
5
3
2
7

<tbody>
</tbody>


4. Multiply each number by its assigned weight

1
0
0
0
1
0
8
0
3
0
4
5
1
0
0
0
4
4
0
2
1
3
4
0
5
9
9
1
4
7
5
3
2
7
5
3
2
7
5

3
2
7
5
3
2

7
5
3
2
7
5

3
2
7
5
3
2
7
7
0
0
0
7
0
24
0
21
0
12
10
7
0
0
0
28
20
0
4
7
15
12
0
35
45
27
2
28

<tbody>
</tbody>


5. Sum the digits of the results (1st sum the numbers with 2 digits and then sum the entire line, ie: 24 = 2+6=8)

7
0
0
0
7
0
24
0
21
0
12
10
7
0
0
0
28
20
0
4
7
15
12
0
35
45
27
2
28
7
0
0
0
7
0
2+4=6
0
2+1=3
0

1+2=3
1+0=1
7
0
0
0

2+8=10
2+0=2
0
4
7
1+5=6

1+2=3
0
3+5=8
4+5=9
2+7=9
2
2+8=10
7
7
7
7
14
14
20
20
23
23
26
27
34
34
34
34
44
46
46
50
57
63
66
66
74
83
92
94
104

<tbody>
</tbody>


6. Divide the sum by the modulus 10 to determine the remainder
Ex: 104/10=10.4 – the remainder is 4

7. Subtract the remainder* from the Modulus 10 to determine the check digit
* If the remainder is 0, then the check digit equals 0
Ex: 10-4=6 – the check digit is 6
 
You have an example where the check digit is 10?
 
Upvote 0

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
Hi,

Alternative, formula-based solution:

Array formula**:

=10-MOD(SUM(0+MID(TEXT(IF(1-ISNUMBER(0+MID(A1,ROW(INDIRECT("1:"&LEN(A1))),1)),1+MOD(CODE(MID(A1,ROW(INDIRECT("1:"&LEN(A1))),1))-65,9),MID(A1,ROW(INDIRECT("1:"&LEN(A1))),1))*MID(7532,1+MOD(ROW(INDIRECT("1:"&LEN(A1)))-1,4),1),"00"),{1,2},1)),10)

Regards


**Array formulas are not entered in the same way as 'standard' formulas. Instead of pressing just ENTER, you first hold down CTRL and SHIFT, and only then press ENTER. If you've done it correctly, you'll notice Excel puts curly brackets {} around the formula (though do not attempt to manually insert these yourself).


GivenReturnCK#
0663711DM0116LCLCLAF9160663711DM0116LCLCLAF9161010
0813016DM1022LCLCLBS2580813016DM1022LCLCLBS2581010
15456524VGFX255415GF54215456524VGFX255415GF54233
25715658FFCH2365FFD365225715658FFCH2365FFD365255
254745544JDSUJN4562455214254745544JDSUJN456245521455
26585425654HJDSAGDHG45445426585425654HJDSAGDHG45445455
#REF!#REF!
#REF!#REF!
#REF!#REF!

<colgroup><col><col><col></colgroup><tbody>
</tbody>
=10-MOD(SUM(0+MID(TEXT(IF(1-ISNUMBER(0+MID(C2,ROW(INDIRECT("1:"&LEN(C2))),1)),1+MOD(CODE(MID(C2,ROW(INDIRECT("1:"&LEN(C2))),1))-65,9),MID(C2,ROW(INDIRECT("1:"&LEN(C2))),1))*MID(7532,1+MOD(ROW(INDIRECT("1:"&LEN(C2)))-1,4),1),"00"),{1,2},1)),10)

Same formula, just changed the references. Not sure how to attach the file yet. Not sure I can yet. But here's a cloud link: https://onedrive.live.com/redir?page=view&resid=BC41855B1EB6024B!7300&authkey=!APvDml58FlGteR0
 
Upvote 0
Hi.

You haven't followed the instructions re how to enter an array formula at the foot of my post.

Regards
 
Upvote 0

Forum statistics

Threads
1,215,263
Messages
6,123,954
Members
449,135
Latest member
jcschafer209

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