+ Reply to Thread
Results 1 to 6 of 6

LOTTERY FILTER#4, Find if 1 Digit Sum of 2 Digit or 3 Digit, Single Cell w/ dash

  1. #1
    Forum Contributor
    Join Date
    10-21-2012
    Location
    miami, florida usa
    MS-Off Ver
    Excel 2007
    Posts
    260

    LOTTERY FILTER#4, Find if 1 Digit Sum of 2 Digit or 3 Digit, Single Cell w/ dash

    Hi, !


    i would like to find if in 5 digits 1 digit is the sum of 2 digits, (or) the Sum of 3 Digits

    it's might a lil complex, i've tried to doit but the problem is that the string is inside of single cell
    and it's contain a dash.. ( i'm not excel guru yet)

    Let say in G:12 I got a combination of 5 numbers (separated with dash)

    then i wan to find if in combination a number have a sum of 2 digit or 3 digits, and if Found
    then i would like to identify as :
    -.If No Digit Sum any other digit, then "0D"
    -.If 1 Digit is the Sum of 2 other Digit, then "2D"
    -.If 1 Digit is the Sum of 3 other Digit, then "3D"

    then the result ("OD","2D,"3D") will Add dd in Cell/Column AB:12 down


    example:
    ______________________RESULT
    ____________COL G______COL AB__
    R:12___01-02-05-33-35____ "0D", <--because, no 2 or 3 digit make a Sum of 1 Digit
    R:13___01-02-06-15-33____ "0D", <--because, no 2 or 3 digit make a Sum of 1 Digit
    R:14___02-05-08-17-20____ "0D", <--because, no 2 or 3 digit make a Sum of 1 Digit
    R:15___05-06-14-15-23____ "0D", <--because, no 2 or 3 digit make a Sum of 1 Digit
    R:16___01-02-05-33-35____ "2D", <--because, Digit Sum 02+33 is equal to Digit 35
    R:17___01-02-06-08-32____ "2D", <--because, Digit Sum 02+06 is equal to Digit 08
    R:18___02-05-07-08-20____ "2D", <--because, Digit Sum 02+05 is equal to Digit 07
    R:19___05-06-14-19-29____ "2D", <--because, Digit Sum 05+14 is equal to Digit 19
    R:20___01-02-05-08-19____ "3D", <--because, Digit Sum 01+02+05 is equal to Digit 08
    R:21___01-02-05-14-20____ "3D", <--because, Digit Sum 01+05+14 is equal to Digit 20
    R:22___01-02-06-19-26____ "3D", <--because, Digit Sum 01+06+19 is equal to Digit 26
    R:23___02-05-08-28-35____ "3D", <--because, Digit Sum 02+05+28 is equal to Digit 35




    Thank you for your help !!



    Best Regards

    David

  2. #2
    Registered User
    Join Date
    02-27-2014
    Location
    Range("A1")
    MS-Off Ver
    Excel 2007
    Posts
    24

    Re: LOTTERY FILTER#4, Find if 1 Digit Sum of 2 Digit or 3 Digit, Single Cell w/ dash

    Hi Dave,
    try this code, I didn't work on the reason part yet :-/
    Please Login or Register  to view this content.
    I'll try to find a solution to the reason thing soon.
    NOTE:isn't the first cell of AB in your example supposed to be "2D"? cuz 35 = 33 + 02
    ZAX
    Last edited by DarthVader68; 03-05-2014 at 09:06 AM.
    I'm glad you got it to work :-D
    ZAX

  3. #3
    Forum Contributor
    Join Date
    10-21-2012
    Location
    miami, florida usa
    MS-Off Ver
    Excel 2007
    Posts
    260

    Re: LOTTERY FILTER#4, Find if 1 Digit Sum of 2 Digit or 3 Digit, Single Cell w/ dash

    Hi Darthvader68,


    -.Yes,Indeed you're right about first Cell AB, 02+33 = 35 (Sorry, I skipped),

    -. About the Messages :
    <--because, no X or Y digit make a Sum of X Digit
    <--because, Digit Sum XX+YY is equal to Digit XX
    <--because, Digit Sum XX+YY+ZZ is equal to Digit XX

    I wrote it for explanation purposes, (Sorry again, i didn't to make you work double.. )

    Question : what function name do i have to insert in cell AB12 in order to get the "0D","2d" or "3D"?,
    because in Cell AB12 I inserted
    Please Login or Register  to view this content.
    and sadly didn't work, it pop a excel error message that
    say is not begin with letter or underscore,the name contain space or other invalid character, the name conflict with an excel built-in name..

    So in the code i changed the name to : LotCheckSum, and inserted this name in AB12 and receive same error message..


    please if have a question, pls let me know..


    Appreciated a lot mr Darthvader68..

    Best Regards

    David

  4. #4
    Registered User
    Join Date
    02-27-2014
    Location
    Range("A1")
    MS-Off Ver
    Excel 2007
    Posts
    24

    Re: LOTTERY FILTER#4, Find if 1 Digit Sum of 2 Digit or 3 Digit, Single Cell w/ dash

    Hi David,
    You noticed that this isn't a function, it's a macro, so you can run it by either (1) Press Alt+F8 and double click on the macro name or (2) Assign the macro to a button.
    The macro will look into each cell from G12 down to last cell and put the answer in the adjacent cell in AB.
    And BTW, no you didn't make me double work, I tried the macro and it showed a 2D result in AB12 you know, and even if I double worked that would be ok for me and I would gladly do that to help you, I'm ready to keep working on it until it's solved :-D
    ZAX

  5. #5
    Forum Contributor
    Join Date
    10-21-2012
    Location
    miami, florida usa
    MS-Off Ver
    Excel 2007
    Posts
    260

    Re: LOTTERY FILTER#4, Find if 1 Digit Sum of 2 Digit or 3 Digit, Single Cell w/ dash

    Hi DarthVader68 ,

    Yes i noticed after the post #3.. I apologized, time to time i'm lil dummy (smile)

    Thank you so much, it work perfect !!!!!!!!!!!!

    Best Regards

    David

  6. #6
    Registered User
    Join Date
    02-27-2014
    Location
    Range("A1")
    MS-Off Ver
    Excel 2007
    Posts
    24

    Re: LOTTERY FILTER#4, Find if 1 Digit Sum of 2 Digit or 3 Digit, Single Cell w/ dash

    Quote Originally Posted by david gonzalez View Post
    Hi DarthVader68 ,

    Yes i noticed after the post #3.. I apologized, time to time i'm lil dummy (smile)

    Thank you so much, it work perfect !!!!!!!!!!!!

    Best Regards

    David
    Very glad I helped you, you're very welcome... thank you for the feed back.
    ZAX

+ 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. [SOLVED] Color a single digit in a mult-digit number cell
    By Phyllis in forum Excel General
    Replies: 8
    Last Post: 09-30-2022, 04:22 PM
  2. How to add check digit to 6 digit number string...
    By unclejemima in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-18-2013, 04:19 PM
  3. Adding a digit after the first digit of a cell
    By RickCov in forum Excel General
    Replies: 4
    Last Post: 02-16-2012, 08:03 AM
  4. Replies: 2
    Last Post: 06-17-2010, 08:36 PM
  5. [SOLVED] Tell users how to sort 5 digit and 9 digit zipcodes correctly aft.
    By james.mcgough@comcast.net in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 02-18-2005, 10:06 AM

Tags for this Thread

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