+ Reply to Thread
Results 1 to 7 of 7

Determine the numbers for lottery and how many will be drawn

  1. #1
    Valued Forum Contributor marreco's Avatar
    Join Date
    07-02-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2010
    Posts
    1,862

    Determine the numbers for lottery and how many will be drawn

    Hi.
    I need to randomly select numbers, as determined by the user.
    actually not quite generate a random number, but preexisting raffle numbers from a list, that these numbers will be informed, as well as how many of them will go to lottery.

    1 is informed that the figures are: 14, 25, 38, 51, ​​59, 63, 65, 70, 84, 91 and 99.

    2 How many of this group will be randomly selected.

    These are the criteria to be followed.
    "No xadrez nem sempre a menor dist?ncia entre dois pontos ? uma linha reta" G. Kasparov.

    If your problem is solved, please say so clearly, and mark your thread as Solved: Click the Edit button on your first post in the thread, Click Go Advanced, select b from the Prefix dropdown, then click Save Changes. If more than two days have elapsed, the Edit button will not appear -- ask a moderator to mark it.

  2. #2
    Forum Expert Jakobshavn's Avatar
    Join Date
    08-17-2012
    Location
    Lakehurst, NJ, USA
    MS-Off Ver
    Excel 2007
    Posts
    1,970

    Re: Determine the numbers for lottery and how many will be drawn

    To select a random member of your group:

    =CHOOSE(RANDBETWEEN(1,11),14,25,38,51,59,63,65,70,84,91,99)
    Gary's Student

  3. #3
    Valued Forum Contributor marreco's Avatar
    Join Date
    07-02-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2010
    Posts
    1,862

    Re: Determine the numbers for lottery and how many will be drawn

    Hi.
    I am grateful for your response that helped me a lot!
    Is there any solution to eliminate repeated?

  4. #4
    Forum Expert Jakobshavn's Avatar
    Join Date
    08-17-2012
    Location
    Lakehurst, NJ, USA
    MS-Off Ver
    Excel 2007
    Posts
    1,970

    Re: Determine the numbers for lottery and how many will be drawn

    Do you want to pick a second value without repeating the first?

  5. #5
    Valued Forum Contributor marreco's Avatar
    Join Date
    07-02-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2010
    Posts
    1,862

    Re: Determine the numbers for lottery and how many will be drawn

    Hi.
    by pressing the F9 key, I have some numbers that are repeated.
    70 -->repeats
    25
    70 -->repeats
    59
    91
    63 -->repeats
    38 -->repeats
    51
    63 -->repeats
    38 -->repeats
    38 -->repeats

  6. #6
    Forum Expert Jakobshavn's Avatar
    Join Date
    08-17-2012
    Location
    Lakehurst, NJ, USA
    MS-Off Ver
    Excel 2007
    Posts
    1,970

    Re: Determine the numbers for lottery and how many will be drawn

    To avoid repeats, we need to keep track of which items have already been picked. We will do this in column B. In B1 enter:

    =RANDBETWEEN(1,11)

    In B2 we enter the array formula:

    =LARGE(ROW($1:$11)*NOT(COUNTIF($B$1:B1, ROW($1:$11))), RANDBETWEEN(1,11-ROW(B1)))

    because it is an array formula, it must be entered with CNTRL-SHFT-ENTER rather than just the ENTER key.

    Copy B2 and paste from B3 thru B11.

    Now in A1 enter:

    =CHOOSE(B1,14,25,38,51,59,63,65,70,84,91,99) and copy down thru A11

    A1 is the first pick; A2 is the second pick; etc.
    Last edited by Jakobshavn; 12-09-2012 at 11:06 AM.

  7. #7
    Valued Forum Contributor marreco's Avatar
    Join Date
    07-02-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2010
    Posts
    1,862

    Re: Determine the numbers for lottery and how many will be drawn

    hello Jakobshavn

    I want to thank you for your help, thank you
    I still have to do some testing, but I'll mark as solved!

    thank you very much!!

+ 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