+ Reply to Thread
Results 1 to 8 of 8

Loop thru a table seating with 4 tables & 4 sessions & everyone must meet at each session

  1. #1
    Registered User
    Join Date
    01-25-2012
    Location
    San Francisco, California
    MS-Off Ver
    Excel 2010
    Posts
    9

    Loop thru a table seating with 4 tables & 4 sessions & everyone must meet at each session

    Can some one help me with a script that will run a loop or perhaps multiple nested loops, where the people seated in the 4 tables will meet each other at least once during the 4 sessions?

    Thanks.

  2. #2
    Forum Contributor
    Join Date
    10-13-2012
    Location
    Southern California
    MS-Off Ver
    Excel 2007
    Posts
    403

    Re: Loop thru a table seating with 4 tables & 4 sessions & everyone must meet at each sess

    How many people are at each table?

  3. #3
    Registered User
    Join Date
    01-25-2012
    Location
    San Francisco, California
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Loop thru a table seating with 4 tables & 4 sessions & everyone must meet at each sess

    Hi Ed_Collins, there are 6 people at each table.

  4. #4
    Forum Contributor
    Join Date
    10-13-2012
    Location
    Southern California
    MS-Off Ver
    Excel 2007
    Posts
    403

    Re: Loop thru a table seating with 4 tables & 4 sessions & everyone must meet at each sess

    Unless I'm missing something, it's not possible for everyone to meet everyone in just four sessions.

    6 people per table x 4 tables = 24 participants. Lets label each participant A through X. (The first 24 letters of the alphabet.)

    Assume A sits with B, C, D, E, and F during the first session.
    Assume A sits with G, H, I, J, and K during the second session.
    Assume A sits with L, M, N, O, and P during the third session.
    Assume A sits with Q, R, S, T, and U during the fourth session.

    As far as A is concerned, you can't get any more efficient than that. Notice he didn't sit with anyone twice. And yet he wasn't able to sit with V, W or X.

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

    Re: Loop thru a table seating with 4 tables & 4 sessions & everyone must meet at each sess

    Here's a solution for 7 rounds of 6 tables of 4 people by Harvey Warwick:

    [[1, 2, 11, 21], [9, 10, 19, 5], [17, 18, 3, 13], [4, 7, 6, 24], [8, 12, 14, 15], [16, 20, 22, 23]]

    [[1, 3, 12, 22], [9, 11, 20, 6], [17, 19, 4, 14], [5, 8, 7, 18], [2, 13, 15, 16], [10, 21, 23, 24]]

    [[1, 4, 13, 23], [9, 12, 21, 7], [17, 20, 5, 15], [6, 2, 8, 19], [3, 10, 14, 16], [11, 18, 22, 24]]

    [[1, 5, 14, 24], [9, 13, 22, 8], [17, 21, 6, 16], [7, 3, 2, 20], [4, 10, 11, 15], [12, 18, 19, 23]]

    [[1, 6, 15, 18], [9, 14, 23, 2], [17, 22, 7, 10], [8, 4, 3, 21], [5, 11, 12, 16], [13, 19, 20, 24]]

    [[1, 5, 16, 19], [9, 15, 24, 3], [17, 23, 8, 11], [2, 5, 4, 22], [6, 10, 12, 13], [14, 18, 20, 21]]

    [[1, 8, 10, 20], [9, 16, 18, 4], [17, 24, 2, 12], [3, 6, 5, 23], [7, 11, 13, 14], [15, 19, 21, 22]]
    Entia non sunt multiplicanda sine necessitate

  6. #6
    Registered User
    Join Date
    01-25-2012
    Location
    San Francisco, California
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Loop thru a table seating with 4 tables & 4 sessions & everyone must meet at each sess

    Thanks Ed_Collins. Is there a VBA script that will loop through this and assign seating to 6 tables? Thanks.

  7. #7
    Forum Contributor
    Join Date
    10-13-2012
    Location
    Southern California
    MS-Off Ver
    Excel 2007
    Posts
    403

    Re: Loop thru a table seating with 4 tables & 4 sessions & everyone must meet at each sess

    See if the following link helps. shg (Post #5 above), helped to contribute to it, back in 2010.

    http://www.mrexcel.com/forum/excel-q...ets-twice.html
    Last edited by Ed_Collins; 07-01-2015 at 02:52 PM. Reason: typo

  8. #8
    Registered User
    Join Date
    01-25-2012
    Location
    San Francisco, California
    MS-Off Ver
    Excel 2010
    Posts
    9

    Re: Loop thru a table seating with 4 tables & 4 sessions & everyone must meet at each sess

    So I modified mighty mouse’s formula: Formula for random seating and MrExcel MVP's formula: Wedding Seating Chart.

    In column B I randomly selected numbers using the formula =LARGE(ROW($1:$24)*NOT(COUNTIF($B$1:B1,ROW($1:$24))),RANDBETWEEN(1,24+1-ROW(B1))).

    Then in column C I manually listed 1 through 6 (C1:C7) and followed the formula =LARGE(ROW($1:$24)*NOT(COUNTIF($C$1:C7,ROW($1:$24))),RANDBETWEEN(1,24+1-ROW(C7))) dragged it all the way to C25 for a count of 24 people.

    In column D I incremented column C2:C7 by 2,3,4,5,6,7, so C2 = 1 +2, which makes D2 = 3, C3 = 2 + 3, which makes D3 = 5. I did this all the way to D7 = 13. Then I used the formula =LARGE(ROW($1:$24)*NOT(COUNTIF($D$1:D7,ROW($1:$24))),RANDBETWEEN(1,24+1-ROW(D7))) and dragged it all the way to D25 for a count of 24 people.

    In column E I incremented column D2:D7 in the same way, by 2,3,4,5,6,7, so D2 = 2 + 2, which makes E2 = 4, D3 = 5 +3, which makes E3 = 8. I did this all the way to E7 = 20. Then I used the formula =LARGE(ROW($1:$24)*NOT(COUNTIF($E$1:E7,ROW($1:$24))),RANDBETWEEN(1,24+1-ROW(E7))) and dragged it all the way to E25 for a count of 24 people.

    Seating_24.png
    Attached Images Attached Images
    Last edited by hoshangc@yahoo.com; 07-07-2015 at 04:36 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Table Seating Plan for Wedding
    By philde in forum Excel General
    Replies: 9
    Last Post: 03-30-2015, 03:09 AM
  2. Need Help Hyperlinking to a Batch File
    By danaconda84 in forum Excel General
    Replies: 0
    Last Post: 09-04-2013, 01:32 PM
  3. Replies: 2
    Last Post: 05-07-2012, 04:24 AM
  4. Replies: 1
    Last Post: 05-04-2012, 03:10 PM
  5. No duplicate repeat for each session and table
    By JieJenn in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-08-2012, 08:19 AM

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