+ Reply to Thread
Results 1 to 12 of 12

When a number has been drawn last time ?

  1. #1
    Registered User
    Join Date
    06-02-2012
    Location
    Romania
    MS-Off Ver
    Excel 2010
    Posts
    95

    When a number has been drawn last time ?

    I want to get the number last draw in excel, as follow:
    Please Login or Register  to view this content.
    On the other excel sheet I have all the numbers from 1 to 49 and for each one of them I have a number which say to me when each number has been last time drawn.
    In this example we should get:
    No. 12 ---> drawn last time 2 draws ago.
    for No. 25 ---> we should get that it has been drawn last time 3 draws ago (in the first draw if you see better).
    and so on.
    Basically what the needed formula should do ?
    It should search back from the last draw until it find the number it is searching for. Then it should get the row number where it finds that number. Row number is the number of draw itself. (position doesn't matter, it matters only the draw not the position of each numbers) Then it should make the difference between the last draw which is represented by its row number - the row number where it finds the number it searched for. This = to "last time has been drawn".
    Please, help me with this.

    Thank you so much !

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,602

    Re: When a number has been drawn last time ?

    Nob0OOdy can't win a lottery

  3. #3
    Registered User
    Join Date
    06-02-2012
    Location
    Romania
    MS-Off Ver
    Excel 2010
    Posts
    95

    Re: When a number has been drawn last time ?

    cmin, please, I need this formula. pleeeease !
    Thank you so much !

  4. #4
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: When a number has been drawn last time ?

    arrange the data with newest first then match down each column and take the minimum of those matches
    sort of
    =min(iferror(match(49,a1:a1000,0),"0"),iferror(match(49,b1:b1000,0),"0"),iferror(match(49,c1:c1000,0),"0"),iferror(match(49,d1:d1000,0),"0"),iferror(match(49,e1:e1000,0),"0"),iferror(match(49,f1:f1000,0),"0"))
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  5. #5
    Registered User
    Join Date
    06-02-2012
    Location
    Romania
    MS-Off Ver
    Excel 2010
    Posts
    95

    Re: When a number has been drawn last time ?

    Could you make it to work without to re-arrange the data with newest first, please ?

    Thank you !

  6. #6
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: When a number has been drawn last time ?

    no, why its easy enough, just copy your data to a new sheet
    number down in say column g 1.2.3.... then sort by col g descending
    and as its for a lottery calculator i really cant be bothered to try
    but you can reverse the list on another sheet with a few functions which you can match against
    Attached Files Attached Files
    Last edited by martindwilson; 06-24-2012 at 05:20 AM.

  7. #7
    Registered User
    Join Date
    06-02-2012
    Location
    Romania
    MS-Off Ver
    Excel 2010
    Posts
    95

    Re: When a number has been drawn last time ?

    Look, I did like you have said but I don't understand how to use your formula. Look what I did in the file added as attachment, please.
    Wat I did wrong ?

    Thank you in advance !
    Attached Files Attached Files

  8. #8
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: When a number has been drawn last time ?

    oops
    =min(iferror(match(49,a1:a1000,0),10^99),iferror(match(49,b1:b1000,0),10^99),iferror(match(49,c1:c1000,0 ),10^99),iferror(match(49,d1:d1000,0),10^99),iferror(match(49,e1:e1000,0),10^99),iferror(match(49,f1:f1000 ,0),10^99))
    i dont know where "0"came from and it should be a number bigger that your last row!
    Last edited by martindwilson; 06-24-2012 at 05:26 AM.

  9. #9
    Registered User
    Join Date
    06-02-2012
    Location
    Romania
    MS-Off Ver
    Excel 2010
    Posts
    95

    Re: When a number has been drawn last time ?

    Quote Originally Posted by martindwilson View Post
    oops
    =min(iferror(match(49,a1:a1000,0),10^99),iferror(match(49,b1:b1000,0),10^99),iferror(match(49,c1:c1000,0 ),10^99),iferror(match(49,d1:d1000,0),10^99),iferror(match(49,e1:e1000,0),10^99),iferror(match(49,f1:f1000 ,0),10^99))
    i dont know where "0"came from and it should be a number bigger that your last row!
    tested it on the file "test.xlsx" I just uploaded and it still doesn't work...

  10. #10
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: When a number has been drawn last time ?

    your not having a lot of luck,how do you expect to win the lottery?
    works fine for me it shows 1e+99 thats coz 49 is not found
    conditional format to hide it would be easiest
    Attached Files Attached Files
    Last edited by martindwilson; 06-24-2012 at 05:46 AM.

  11. #11
    Registered User
    Join Date
    06-02-2012
    Location
    Romania
    MS-Off Ver
    Excel 2010
    Posts
    95

    Re: When a number has been drawn last time ?

    It works now.
    Thank you !

    [thread solved]

  12. #12
    Valued Forum Contributor
    Join Date
    04-03-2012
    Location
    East Sussex, UK
    MS-Off Ver
    Excel 2003:2010
    Posts
    893

    Re: When a number has been drawn last time ?

    Quote Originally Posted by martindwilson View Post
    your not having a lot of luck,how do you expect to win the lottery?
    Drink came out my nose when I read that..
    If I've been of help, please hit the star

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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