Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Lowkey
 
Posts: n/a
Default Algorithm Challenge

I am trying to create a check digit worksheet for an algorithm where staff
have to use the algorithm hundreds of times daily, so it has to be quick and
efficient.

The algorithm works where the first 12 digits are multiplied and summed
using simple math, and the REMAINDER of the of the sum divided by 9 must
equal the 13th digit.

For example:
My number is 0500450002883, so
1x0=0
2x5=10
3x0=0
4x0=0
5x4=20
6x5=30
7x0=0
8x0=0
9x0=0
10x2=20
11x8=88
12x8=96
where the sum = 264. If you divide 264 by 9, the remaider is 3, the check
digit.

What formula can I use to produce the remaider for 264/9 instead of getting
29.33?

  #2   Report Post  
Bob Phillips
 
Posts: n/a
Default

=MOD(SUMPRODUCT(--(MID(A17,ROW(INDIRECT("1:12")),1)),ROW(INDIRECT("1 :12"))),
9)

--
HTH

Bob Phillips

"Lowkey" wrote in message
...
I am trying to create a check digit worksheet for an algorithm where staff
have to use the algorithm hundreds of times daily, so it has to be quick

and
efficient.

The algorithm works where the first 12 digits are multiplied and summed
using simple math, and the REMAINDER of the of the sum divided by 9 must
equal the 13th digit.

For example:
My number is 0500450002883, so
1x0=0
2x5=10
3x0=0
4x0=0
5x4=20
6x5=30
7x0=0
8x0=0
9x0=0
10x2=20
11x8=88
12x8=96
where the sum = 264. If you divide 264 by 9, the remaider is 3, the check
digit.

What formula can I use to produce the remaider for 264/9 instead of

getting
29.33?



  #3   Report Post  
Bernard Liengme
 
Posts: n/a
Default

To add to Bob's reply:
The value must be entered as '0500450002883 to preserve the leading zero
To check if remainder equals 13th digit:
=MOD(SUMPRODUCT(--(MID(A17,ROW(INDIRECT("1:12")),1)),ROW(INDIRECT("1 :12"))),
9)=VALUE(RIGHT(A17))
The INDIRECT is not needed unless you plan to copy the formula to other
cells
=MOD(SUMPRODUCT(--(MID(A19,ROW(1:12),1)),ROW(1:12)),
9)=VALUE(RIGHT(A19)
best wishes
Bernard V Liengme
www.stfx.ca/people/bliengme
remove caps from email

"Bob Phillips" wrote in message
...
=MOD(SUMPRODUCT(--(MID(A17,ROW(INDIRECT("1:12")),1)),ROW(INDIRECT("1 :12"))),
9)

--
HTH

Bob Phillips

"Lowkey" wrote in message
...
I am trying to create a check digit worksheet for an algorithm where
staff
have to use the algorithm hundreds of times daily, so it has to be quick

and
efficient.

The algorithm works where the first 12 digits are multiplied and summed
using simple math, and the REMAINDER of the of the sum divided by 9 must
equal the 13th digit.

For example:
My number is 0500450002883, so
1x0=0
2x5=10
3x0=0
4x0=0
5x4=20
6x5=30
7x0=0
8x0=0
9x0=0
10x2=20
11x8=88
12x8=96
where the sum = 264. If you divide 264 by 9, the remaider is 3, the check
digit.

What formula can I use to produce the remaider for 264/9 instead of

getting
29.33?





  #4   Report Post  
Bob Phillips
 
Posts: n/a
Default


"Bernard Liengme" wrote in message
...

The value must be entered as '0500450002883 to preserve the leading zero


You could always force it

=MOD(SUMPRODUCT(--(MID(TEXT(A1,"0000000000000"),ROW(INDIRECT("1:12") ),1)),RO
W(INDIRECT("1:12"))),9)



  #5   Report Post  
Harlan Grove
 
Posts: n/a
Default

Bob Phillips wrote...
....
You could always force it

=MOD(SUMPRODUCT(--(MID(TEXT(A1,"0000000000000"),ROW(INDIRECT("1:12") ),1)),
ROW(INDIRECT("1:12"))),9)


Why not just treat it as a number in the first place?

=MOD(SUMPRODUCT(INT(A1/10^{1;2;3;4;5;6;7;8;9;10;11;12})
-10*INT(A1/10^{2;3;4;5;6;7;8;9;10;11;12;13}),
{12;11;10;9;8;7;6;5;4;3;2;1}),9)

This is lots longer, but if you name the array something like ARRAY, it
becomes

=MOD(SUMPRODUCT(INT(A1/10^ARRAY)-10*INT(A1/10^(1+ARRAY)),13-ARRAY),9)

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Complicated Challenge lee6553 Excel Discussion (Misc queries) 7 July 21st 05 02:55 PM
A Challenge Jazzer Excel Worksheet Functions 3 July 8th 05 05:08 PM
MATCH FUNCTION?...challenge cecilluen Excel Worksheet Functions 3 June 27th 05 09:06 PM
Comparison Challenge Firevic Excel Discussion (Misc queries) 1 June 2nd 05 01:42 AM
Divide Ranks into two teams (mathematical guru challenge) Theatre Admin Excel Discussion (Misc queries) 4 February 10th 05 02:15 PM


All times are GMT +1. The time now is 05:29 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"