View Single Post
  #3   Report Post  
Harlan Grove
 
Posts: n/a
Default

"Jason Morin" wrote...
Based on the instruction for calculating a MOD 10 check
digit at this website,

http://www.morovia.com/education/utility/upc-ean.asp


None of the entries on this web site deal with 16th checksum digit based on
the first 15 digits.

you could use this formula:

=10-MOD(SUMPRODUCT(MID(A1,ROW(INDIRECT("1:"&ROUNDUP(LE N
(A1)/2,0)))*2-1,1)+0)*IF(ISODD(LEN(A1)),3,1)+SUMPRODUCT
(MID(A1,ROW(INDIRECT("1:"&INT(LEN(A1)/2)))*2,1)+0)*IF
(ISODD(LEN(A1)),1,3),10)

....

And now you're completely screwed up. On *your* web site all the odd digits
are multiplied by 3 (other than ISBN, which is really weird), but the OP
provided a link to a web site describing LUHN check digits, in which
alternate digits are multiplied by *TWO* and the resulting digits summed.
Were you just too lazy to check the site for which the OP provided a link,
or did you fail to understand it?

Anyway, LUHN checksums have been handled before in this ng, but I can't find
a formula Here's one that doesn't need to be an array formula.

=10-MOD(SUMPRODUCT((MID(B1,ROW(INDIRECT("1:15")),1)"0 ")
*(1+MOD(MID(B1,ROW(INDIRECT("1:15")),1)
*(1+MOD(ROW(INDIRECT("1:15")),2))-1,
10-MOD(ROW(INDIRECT("1:15")),2)))),10)

Here's one that does have to be an array formula.

=10-MOD(SUM(FIND(MID(B1,ROW(INDIRECT("1:15")),1),
IF(MOD(ROW(INDIRECT("1:15")),2),"0516273849","0123 456789"))-1),10)