+ Reply to Thread
Results 1 to 5 of 5

Excel 2007 : Random number generator without repeats

  1. #1
    Registered User
    Join Date
    03-23-2011
    Location
    Houston, TX
    MS-Off Ver
    Excel 2007
    Posts
    2

    Question Random number generator without repeats

    I am currently using this formula for random drug screening; however, it often repeats a number. For simplicity here, lets say I have 10 names in a column on the left with a header row.
    I would use:
    =RAND()*(11-1)+1 where 11 is the last row number with a name populated. I would then have the spreadsheet set up this way:
    Column 1 numbers 1 through however many employees I have; Column 2 employee names; column 3 formula in cell C1. I would drag C1's formula through how ever many rows I want employees selected for. If I want 50% chosen randomly to test I drag through 5 rows. It generates 5 numbers I match to the name next to that number generated. EXCEPT: it will repeat numbers already selected. How do I make it not repeat an already chosen number?
    Thanks,
    Jim, HR Director

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Random number generator without repeats

    In an convenient column, =RAND()

    Then sort by that column and pick the top N names from the list.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    03-23-2011
    Location
    Houston, TX
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Random number generator without repeats

    Quote Originally Posted by shg View Post
    In an convenient column, =RAND()

    Then sort by that column and pick the top N names from the list.
    I tried that and it did not work for me. Hmmm, I must be missing something. It only gave me zeros and ones. Machine language, LOL

  4. #4
    Valued Forum Contributor
    Join Date
    05-19-2010
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2010
    Posts
    391

    Re: Random number generator without repeats


  5. #5
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Random number generator without repeats

    It only gave me zeros and ones.
    Format as General to see all the decimals, though it will not affect the result of the sorting

+ 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