+ Reply to Thread
Results 1 to 7 of 7

Redundancy check

  1. #1
    Registered User
    Join Date
    10-08-2008
    Location
    Spain
    Posts
    8

    Redundancy check

    Hi there,
    Setting up a worksheet to check a string of 7 numbers has the correct check letter attached. Example
    X4032818 X is the check letter. One method is take the 1st number multiply by 1, 2nd multiply by 2, 3rd multiply by 3, 4th x 4, 5th x 5, 6th x 6, 7th x 7. Add the results, in this case equals 123. Divide this result by 25 (the letter Z is not used) the remainder (23) matches the 23rd letter in the alphabet. To cater for when the remainder is 0, the range is 0=A Y=24.
    I am using MID to extract each number
    Please Login or Register  to view this content.
    Instead of six seperate cells in Row C using MID is there a quicker way?
    Last edited by Galceran; 10-08-2008 at 01:07 PM.

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,482
    Assuming you test string is in A1 you could use this to return TRUE or FALSE

    =CHAR(65+MOD(SUMPRODUCT((MID(A1,ROW(2:8),1)*ROW(1:7))),25))=LEFT(A1,1)
    Cheers
    Andy
    www.andypope.info

  3. #3
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,454
    =char((mod(sum(mid(c2,{2,3,4,5,6,7,8},1)*{1,2,3,4,5,6,7}),25)+65))
    Rule 1: Never merge cells
    Rule 2: See rule 1

    "Tomorrow I'm going to be famous. All I need is a tennis racket and a hat".

  4. #4
    Registered User
    Join Date
    10-08-2008
    Location
    Spain
    Posts
    8
    It is in C2, changed the A1 ref but it returns #value.
    this is what I have in A2: X4032818
    B2:
    Please Login or Register  to view this content.
    C2:
    Please Login or Register  to view this content.
    D2:
    Please Login or Register  to view this content.
    et seq
    J2:
    Please Login or Register  to view this content.
    K2:
    Please Login or Register  to view this content.
    In this instance K2 returns 23, which is X in the lookup table returned in B2
    I am trying to consolidate D to J or, is this not feasible

    Thanks
    Gilbert

  5. #5
    Registered User
    Join Date
    10-08-2008
    Location
    Spain
    Posts
    8
    Thanks Sweep

    I am obviously entering your formuals in the wrong cell, where should it go. Does it replace all in D2:J2?

    Thanks

  6. #6
    Registered User
    Join Date
    10-08-2008
    Location
    Spain
    Posts
    8
    Right. Put it in D2 and cleared rest of the row.
    The object of the exercise is to confirm that X is the correct check letter. It isn't just extracting the X is it ?

    Thanks

  7. #7
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,482
    See attached which has both sweep's and my formula.
    Including a break out of the major parts so you can see it is not just extracting the X
    Attached Files Attached Files

+ 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. Excel 2007 : help with check boxes
    By lmm07468 in forum Excel General
    Replies: 3
    Last Post: 03-04-2011, 01:40 PM
  2. Check Boxes & Linkedcell
    By MBigD011 in forum Excel - New Users/Basics
    Replies: 8
    Last Post: 03-15-2010, 10:34 AM
  3. VBA; find string and copy
    By Bill Rudd in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 03-06-2008, 10:41 PM
  4. Bank rec v2, deleting matching check #'s
    By Jerhansen277 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-09-2007, 11:59 AM
  5. Check Box - Forms
    By SJG in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-29-2007, 07:09 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