# checksum for bar codes - calculation help needed

This topic is 7572 days old. Please don't post here. Open a new topic instead.

## Recommended Posts

Hi everyone !

Need help with putting together the following formula:

The calculation for the checksum for UPC barcodes is pretty straightforward.

There are 11 digits

Sum of odd digits (first, third, fifth, ....). Multiply by 3.

Sum of even digits (second, fourth, sixth...)

Keep only the units digit ( drop all else). Subtract from 10.

= checksum.

Greatly appreciate any help with this.

Thanks.

~ jack

##### Share on other sites

(ALL FIELDS ARE NUMBERS)

BARCODE

SUM OF ODDS = Left(BARCODE,1) + Middle( BARCODE, 3, 1)+ Middle( BARCODE, 5, 1)+ Middle( BARCODE, 7, 1)+ Middle( BARCODE, 9, 1)+ Middle( BARCODE, 11, 1)

SUM OF EVENS = Middle( BARCODE, 2, 1)+ Middle( BARCODE, 4, 1)+ Middle( BARCODE, 6, 1)+ Middle( BARCODE, 8, 1)+ Middle( BARCODE, 10, 1)

SUM OF ODDS EVENS = SUM OF ODDS + SUM OF EVENS

RIGHT ONE = RIGHT ( SUM OF ODDS EVENS , 1)

SUB FM 10 = 10 - RIGHT ONE

EASIER TO "SEE" THIS WAY -- cAN COMBINE INTO ONE FIELD IF DESIRED

##### Share on other sites

Hi Jack,

Not sure where you are headed with this project, but you might be interested in this sample file by Christian Jaeger

HTH

Lee

##### Share on other sites

z...

Thanks, not only for the calculation, but also for doing it in a way that is easily understandable.

~jack

##### Share on other sites

Lee:

Thanks for the information.

I have about 600 items for which I have to provide the bar code (including the checksum) so I figured the easiest way is to increment each one, calculate the checksum and put it all together so the bar code can be printed.

Hope I'm right .....

~ jack

##### Share on other sites

This topic is 7572 days old. Please don't post here. Open a new topic instead.

## Create an account

Register a new account