Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 921
Default Divide into groups.

I have a list of 25 to 50 people and would like to divide them into 13
groups. How would I do this?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 921
Default Divide into groups.

Just to clarify. The names or in A1 €“ A52 and I would like to sort them in A1
€“ 52. If there are only 26 names then they would be in groups of 2 down A1 €“
A52. Thanks! Jeff

"Jeff" wrote:

I have a list of 25 to 50 people and would like to divide them into 13
groups. How would I do this?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Divide into groups.


I assume you are looking to randomly assign the people to the groups.
Is there any other restictions? Do you want to evenly divide these
people among the groups so 25 people would have 12 groups of 2 people
and one group of 1. Or some other division.


Usually you assign a random number to each person and then sort by the
random number. Then perform an algorith to make the groups

Sub RandomGroups()

Dim Groups(0 To 12, 0 To 3)

'initialize random generator
Randomize

'Assume name are on column A
LastRow = Range("A" & Rows.Count).End(xlUp).Row

'assign rtandom number
For RowCount = 1 To LastRow
Range("B" & RowCount) = Rnd
Next RowCount

'sort on random number
Rows("1:" & LastRow).Sort _
header:=xlNo, _
key1:=Range("B1"), _
order1:=xlAscending

For RowCount = 1 To LastRow
GroupNum = (RowCount - 1) Mod 13
IndexNum = Int((RowCount - 1) / 13)
Groups(GroupNum, IndexNum) = Range("A" & RowCount)
Next RowCount


End Sub


--
joel
------------------------------------------------------------------------
joel's Profile: 229
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=170638

Microsoft Office Help

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Divide variable numbers into groups Marie Bayes Excel Discussion (Misc queries) 2 July 28th 09 06:53 PM
Divide sheet into groups Jeff Excel Programming 3 January 27th 09 02:25 PM
Divide a list into Groups SerpentineFire Excel Discussion (Misc queries) 3 May 14th 08 06:08 PM
Want to divide a number into groups of thousands Ooley Excel Discussion (Misc queries) 3 August 24th 07 08:54 PM
divide a large group of people into smaller groups by their vote siku Excel Discussion (Misc queries) 1 August 26th 05 05:42 PM


All times are GMT +1. The time now is 04:00 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"