+ Reply to Thread
Results 1 to 6 of 6

HOW-TO make a random selection from a set of data and divide it into sub-team

Hybrid View

  1. #1
    Registered User
    Join Date
    06-22-2012
    Location
    Greece
    MS-Off Ver
    Excel 2003
    Posts
    3

    Question HOW-TO make a random selection from a set of data and divide it into sub-team

    Hi,

    I need some help. I need to divide a group people in random teams and have these groups reformed twice per month. here is an example. Lets say i have a group of 10 people and need to divide them in random teams of 2

    A
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10

    I would like a result like 1-4, 2-10, 9-5, 7-6, 8-3 Which function can give a result like that? I need combinations of people where each person cannot be in more than one team.

    Is it possible in Excel?

    Thank you

  2. #2
    Forum Expert dilipandey's Avatar
    Join Date
    12-05-2011
    Location
    Dubai, UAE
    MS-Off Ver
    1997 - 2016
    Posts
    8,191

    Re: HOW-TO make a random selection from a set of data and divide it into sub-team

    Hi Zanat0s,

    Welcome to the forum.

    You can use Random function (Rand or Randbetwen)here to pick up the names of random basis
    First give serial numbers to the names and then use Random function to pick up those names to form Teams..

    In case of any issues, please upload a sample file. Thanks.

    Regards,
    DILIPandey

    <click on below 'star' if this helps>
    DILIPandey, Excel rMVP
    +919810929744 (India), +971528225509 (Dubai), dilipandey@gmail.com

  3. #3
    Registered User
    Join Date
    06-22-2012
    Location
    Greece
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: HOW-TO make a random selection from a set of data and divide it into sub-team

    Dillip,

    Unfortunately that doesn't solve my issue.

    Why?

    even if i use Randbetween some Numbers(people) might appear more than twice...
    Last edited by zanat0s; 06-22-2012 at 04:59 AM.

  4. #4
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: HOW-TO make a random selection from a set of data and divide it into sub-team

    try
    
    Sub test()
        Dim r As Range, i As Long, n As Long
        With CreateObject("System.Collections.SortedList")
            Randomize
            For Each r In Range("a1", Range("a" & Rows.Count).End(xlUp))
                .Item(Rnd) = r.Value
            Next
            Columns(3).NumberFormat = "@"
            For i = 0 To .Count - 1 Step 2
                If i + 1 > .Count - 1 Then Exit For
                n = n + 1
                Cells(n, 3).Value = _
                .GetByIndex(i) & " - " & .GetByIndex(i + 1)
            Next
        End With
    End Sub

  5. #5
    Registered User
    Join Date
    06-22-2012
    Location
    Greece
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: HOW-TO make a random selection from a set of data and divide it into sub-team

    Jindon

    i will try this. Here are the exact data : 16 people 4 teams...

  6. #6
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: HOW-TO make a random selection from a set of data and divide it into sub-team

    If odd number of players, one player will be left off.

    And hope your Windows version is later than XP.
    Last edited by jindon; 06-22-2012 at 05:30 AM.

+ 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