+ Reply to Thread
Results 1 to 11 of 11

Randomizing set group of numbers

  1. #1
    Registered User
    Join Date
    10-22-2009
    Location
    Roanoke, indiana
    MS-Off Ver
    Excel 2010
    Posts
    94

    Randomizing set group of numbers

    I have a group of 19 numbers representing different groups of employees, I need to randomize those 19 numbers into days of the week for training mon-saturday for 10 weeks.

    so I have like 19,21,33,4,7,18,20,34 .... randomized into 21,33,4,20,7,18 <--week 1

    34,4,7,20,21,19 <-- week 2 ect...
    can this be done?
    Last edited by komet12; 03-08-2012 at 07:53 AM.

  2. #2
    Forum Contributor darknation144's Avatar
    Join Date
    01-24-2012
    Location
    London
    MS-Off Ver
    Microsoft Excel 365 MSO
    Posts
    555

    Re: Randomizing set group of numbers

    Do you want to use your random numbers or any random numbers? Also please post a sample workbook.

  3. #3
    Registered User
    Join Date
    10-22-2009
    Location
    Roanoke, indiana
    MS-Off Ver
    Excel 2010
    Posts
    94

    Re: Randomizing set group of numbers

    Ok I have made some progress please view the sheet using =INDEX($a$2:$a$20,RANDBETWEEN(1,19))
    Attached Files Attached Files

  4. #4
    Forum Contributor darknation144's Avatar
    Join Date
    01-24-2012
    Location
    London
    MS-Off Ver
    Microsoft Excel 365 MSO
    Posts
    555

    Re: Randomizing set group of numbers

    So you can't have duplicates per day or per week?

  5. #5
    Registered User
    Join Date
    10-22-2009
    Location
    Roanoke, indiana
    MS-Off Ver
    Excel 2010
    Posts
    94

    Re: Randomizing set group of numbers

    per any given 6 day period

  6. #6
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Randomizing set group of numbers

    Take a look at this workbook. You randomize using the RAND() function and sorting. Then transpose your first 6 values.
    Is this what you were looking for?
    Attached Files Attached Files
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  7. #7
    Registered User
    Join Date
    10-22-2009
    Location
    Roanoke, indiana
    MS-Off Ver
    Excel 2010
    Posts
    94

    Re: Randomizing set group of numbers

    Actually the 19 numbers are actually set, as in the test schedule sheet in column A then those need to be set randomly thru each week without duplication. I solved the matter of getting the random 6 per week using the index formula but having an issue with duplicates in the week.

  8. #8
    Registered User
    Join Date
    10-22-2009
    Location
    Roanoke, indiana
    MS-Off Ver
    Excel 2010
    Posts
    94

    Re: Randomizing set group of numbers

    Good Day to you all.

    on the attached workbook I copied the random numbers to sheet 2 in a numeric format. Is there a way that I can find the duplicates in each row and highlight them so I could manually fix the duplication?
    Attached Files Attached Files

  9. #9
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Randomizing set group of numbers

    You can use conditional formatting.
    Select your range> Conditional Formattting> Use Formula

    =COUNTIF($A2:$F2,A2)>1
    Format as you like
    Does that work for you?

    FYI, my technique (post 6) would have not given you duplicates. I guess I wasn't clear about how it worked. I guess it was a little time consuming also.
    Last edited by ChemistB; 03-07-2012 at 12:03 PM.

  10. #10
    Registered User
    Join Date
    10-22-2009
    Location
    Roanoke, indiana
    MS-Off Ver
    Excel 2010
    Posts
    94

    Re: Randomizing set group of numbers

    That worked , then I sorted by cell color to get 105 unique schedules Thanks

  11. #11
    Forum Expert
    Join Date
    06-26-2010
    Location
    Austin, TX
    MS-Off Ver
    Excel 2010
    Posts
    1,673

    Re: Randomizing set group of numbers

    Coming a bit late to the party, I realize, but this type of question comes up every now and then. Here is some code to shuffle a range into a new array. This at least resolves the removal of duplicates within each shuffle (unless there are duplicates in the original range), but it does not ensure each set of shuffles is unique.

    Please Login or Register  to view this content.
    Good luck,
    Pauley

+ 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