How to derive the CHECK DIGIT of EAN Codes?

xlmaniac

Well-known Member
Joined
Jul 2, 2009
Messages
527
Office Version
  1. 2010
Platform
  1. Windows
Dear All,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:eek:ffice:eek:ffice" /><o:p></o:p>
I am trying to calculate the check digit(13<SUP>th</SUP> digit in the EAN) for my company’s EAN codes based on the 12 digit prefixed number.<o:p></o:p>
The method of calculating of the CHECK DIGIT(13<SUP>th</SUP> & last digit) of EAN is as follows:-<o:p></o:p>
1)The even position number needs to be multiplied by 3.<o:p></o:p>
2) The even position number needs to be multiplied by 1.<o:p></o:p>
3)The result needs to be added(1+2).<o:p></o:p>
4)The result needs to be substracted from the nearest equal or higher multiple of ten.<o:p></o:p>
<o:p></o:p>
I have put one formula to derive the CHECK DIGIT which is yielding the correct result.<o:p></o:p>
Just curious if there is any shorter & smarter formula than the one that I have put.<o:p></o:p>
The sample data is as follows:-<o:p></o:p>
<o:p></o:p>
Sheet1

<TABLE style="BACKGROUND-COLOR: #ffffff; PADDING-LEFT: 2pt; PADDING-RIGHT: 2pt; FONT-FAMILY: Calibri,Arial; FONT-SIZE: 11pt" border=1 cellSpacing=0 cellPadding=0><COLGROUP><COL style="WIDTH: 30px; FONT-WEIGHT: bold"><COL style="WIDTH: 106px"><COL style="WIDTH: 59px"><COL style="WIDTH: 99px"></COLGROUP><TBODY><TR style="TEXT-ALIGN: center; BACKGROUND-COLOR: #cacaca; FONT-SIZE: 8pt; FONT-WEIGHT: bold"><TD> </TD><TD>B</TD><TD>C</TD><TD>D</TD></TR><TR style="HEIGHT: 63px"><TD style="TEXT-ALIGN: center; BACKGROUND-COLOR: #cacaca; FONT-SIZE: 8pt">3</TD><TD style="TEXT-ALIGN: center; FONT-FAMILY: Arial; FONT-SIZE: 10pt; FONT-WEIGHT: bold">12 Digit EAN Codes(Without Check Digit)</TD><TD style="TEXT-ALIGN: center; FONT-FAMILY: Arial; FONT-SIZE: 10pt; FONT-WEIGHT: bold">Check Digit</TD><TD style="TEXT-ALIGN: center; FONT-FAMILY: Arial; FONT-SIZE: 10pt; FONT-WEIGHT: bold">13 Digit EAN Codes(With Check Digit)</TD></TR><TR style="HEIGHT: 18px"><TD style="TEXT-ALIGN: center; BACKGROUND-COLOR: #cacaca; FONT-SIZE: 8pt">4</TD><TD style="TEXT-ALIGN: center; BACKGROUND-COLOR: #ffff99">890257010027</TD><TD style="TEXT-ALIGN: center; BACKGROUND-COLOR: #c0c0c0">7</TD><TD style="TEXT-ALIGN: center; BACKGROUND-COLOR: #c0c0c0">8902570100277</TD></TR></TBODY></TABLE>
<TABLE style="BORDER-BOTTOM-STYLE: groove; BORDER-BOTTOM-COLOR: #00ff00; BACKGROUND-COLOR: #fffcf9; BORDER-TOP-COLOR: #00ff00; BORDER-LEFT-STYLE: groove; FONT-FAMILY: Arial; BORDER-TOP-STYLE: groove; COLOR: #000000; BORDER-RIGHT-COLOR: #00ff00; BORDER-RIGHT-STYLE: groove; FONT-SIZE: 10pt; BORDER-LEFT-COLOR: #00ff00"><TBODY><TR><TD>Spreadsheet Formulas</TD></TR><TR><TD><TABLE style="FONT-FAMILY: Arial; FONT-SIZE: 9pt" border=1 cellSpacing=0 cellPadding=2><TBODY><TR style="BACKGROUND-COLOR: #cacaca; FONT-SIZE: 10pt"><TD>Cell</TD><TD>Formula</TD></TR><TR><TD>C4</TD><TD>=CEILING(MID(B4,1,1)*1+MID(B4,2,1)*3+MID(B4,3,1)*1+MID(B4,4,1)*3+MID(B4,5,1)*1+MID(B4,6,1)*3+MID(B4,7,1)*1+MID(B4,8,1)*3+MID(B4,9,1)*1+MID(B4,10,1)*3+MID(B4,11,1)*1+MID(B4,12,1)*3,10)-(MID(B4,1,1)*1+MID(B4,2,1)*3+MID(B4,3,1)*1+MID(B4,4,1)*3+MID(B4,5,1)*1+MID(B4,6,1)*3+MID(B4,7,1)*1+MID(B4,8,1)*3+MID(B4,9,1)*1+MID(B4,10,1)*3+MID(B4,11,1)*1+MID(B4,12,1)*3)</TD></TR><TR><TD>D4</TD><TD>=B4&C4</TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE>

Excel tables to the web >> http://www.excel-jeanie-html.de/index.php?f=1" target="_blank"> Excel Jeanie HTML 4
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
Try

=MOD(10 - MOD(SUM(MID(A1, {1,2,3,4,5,6,7,8,9,10,11,12}, 1) * {1,3,1,3,1,3,1,3,1,3,1,3}), 10), 10)
 
Upvote 0
Dear Sir,
Thank you so much for helping me out with yet another amazing solution.
I am really honoured & feel priviledged to learn excel from the excel gurus like you.
Pls accept my sincere gratitude for the same.
Thanks once again.
Regards
 
Upvote 0

Forum statistics

Threads
1,214,643
Messages
6,120,707
Members
448,981
Latest member
recon11bucks

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