+ Reply to Thread
Results 1 to 4 of 4

SSCC Check Digit Calculation Formula

  1. #1
    Registered User
    Join Date
    11-25-2012
    Location
    Brantford, Ontario
    MS-Off Ver
    Excel 2010
    Posts
    28

    SSCC Check Digit Calculation Formula

    HI Experts, it's been a while, hope all of you and yours have weathered our current state as well as can be expected - we're approaching better days ahead!

    I need to create a formula that calculates the check digit for 6000 17-digit SSCC numbers (20 digit number with 2 leading zeroes, dropped for purpose of manual calculation of check digit, with the check digit being the last digit, also dropped for purpose of the manual check digit calculation) - the formula used by GS1 is to take the 17 remaining digits, and multiply them as so:

    Digit 1 x 3
    Digit 2 x 1
    Digit 3 x 3
    Digit 4 x 1
    Digit 5 x 3
    Digit 6 x 1
    Digit 7 x 3
    Digit 8 x 1
    Digit 9 x 3
    Digit 10 x 1
    Digit 11 x 3
    Digit 12 x 1
    Digit 13 x 3
    Digit 14 x 1
    Digit 15 x 3
    Digit 16 x 1
    Digit 17 x 3

    Sum the total, then subtract it from the the nearest multiple of 10 or 100 (ex. if the sum is 101, subtract it from 110) - the single digit result of this final subtraction is the check digit.

    Please see example below for what I'm trying to do - the end result I'm striving for is to create a list of 6000 SSCC numbers that I can copy and paste en masse, I need a formula in column B that executes the above and returns the 18 digit result, or, the check digit by itself, and I can join them on my own in column C. This table contains real results using the GS1 check digit calculator online, entering one SSCC, calculating, and the GS1 calculator returning the right check digit for that 17 digit sequence of characters.

    17 SSCC w/o CD 18 digit SSCC w/ Check Digit
    90854441001100000 908544410011000001 (so in this case, the sum total of the 17 using the formula above = 89, next 10th number up = 90, 90-89=1)
    90854441001100001 908544410011000018 (100-92=8)
    90854441001100002 908544410011000025 (100-95=5)
    90854441001100003 908544410011000032 (100-98=2)
    90854441001100004 908544410011000049 (110-101=9)
    90854441001100005 908544410011000056 (110-104=6)

    With my knowledge, the best I can figure for a formula would be a clunky one involving left*X, mid*X and right*X sums, it would do the trick, but hoping somebody smarter than me can provide a more streamlined formula instead?

    Thanks in advance Gurus, your help is always appreciated!

    GK

  2. #2
    Forum Expert KOKOSEK's Avatar
    Join Date
    08-03-2018
    Location
    Pole in Yorkshire, UK
    MS-Off Ver
    365/2013
    Posts
    2,742

    Re: SSCC Check Digit Calculation Formula

    Sum based on digit weight table you can calculate like this:

    Formula: copy to clipboard
    Please Login or Register  to view this content.

    it is array formula so you have to accept it with Ctrl+Shift+Enter not just Enter.
    A2:B18 is a digits weight table.

    I've added two helping columns to get sum and create check digit.

    C
    D
    E
    F
    1
    17 digits SSC
    18 digits SSC
    helper
    CheckDigit
    2
    90854441001100000
    908544410011000001
    89
    1
    3
    90854441001100001
    908544410011000018
    92
    8
    4
    90854441001100002
    908544410011000025
    95
    5
    5
    90854441001100003
    908544410011000032
    98
    2
    6
    90854441001100004
    908544410011000049
    101
    9
    7
    90854441001100005
    908544410011000056
    104
    6


    C
    D
    E
    F
    1
    17 digits SSC
    18 digits SSC
    helper
    CheckDigit
    2
    90854441001100000
    =C2&F2
    =IFERROR(SUM(MID(C2,ROW($1:$17),1)*LOOKUP(ROW($1:$17),$A$2:$A$18,$B$2:$B$18)),"")
    =IF(E2<>"",CEILING(E2,10)-E2,"")
    3
    90854441001100001
    =C3&F3
    =IFERROR(SUM(MID(C3,ROW($1:$17),1)*LOOKUP(ROW($1:$17),$A$2:$A$18,$B$2:$B$18)),"")
    =IF(E3<>"",CEILING(E3,10)-E3,"")
    Attached Files Attached Files
    Happy with my answer * Add Reputation.
    If You are happy with solution, please use Thread tools and mark thread as SOLVED.

  3. #3
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: SSCC Check Digit Calculation Formula

    Please try at B2

    =A2&MOD(-SUMPRODUCT(MID(A2,ROW(A$1:A$17),1)*(MOD(ROW(A$1:A$17),2)*2+1)),10)
    Attached Files Attached Files
    Last edited by Bo_Ry; 05-08-2021 at 12:52 AM. Reason: correction

  4. #4
    Registered User
    Join Date
    11-25-2012
    Location
    Brantford, Ontario
    MS-Off Ver
    Excel 2010
    Posts
    28

    Re: SSCC Check Digit Calculation Formula

    I shall mark this thread as solved, thank you both very much for the working solutions, this level of formula work is far beyond my scope of knowledge, so thank you very much for sharing yours, it's much appreciated!

    Sincerely,
    GK

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Bank Recon - How to convert 8 digit formatted check numbers to 6 digit
    By Quisp in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 06-21-2017, 09:55 PM
  2. EAN 8 check digit formula?
    By unclejemima in forum Excel General
    Replies: 1
    Last Post: 04-28-2017, 11:18 PM
  3. [SOLVED] Unknown Check Digit Calculation
    By kmcbriarty in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 10-30-2013, 10:55 AM
  4. Replies: 4
    Last Post: 03-26-2009, 12:46 PM
  5. Excell Check Digit Formula
    By Ian in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 09-06-2005, 07:05 PM
  6. [SOLVED] Excell Check Digit Formula
    By tnelson in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 03:05 PM
  7. Replies: 8
    Last Post: 06-06-2005, 02:05 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1