+ Reply to Thread
Results 1 to 12 of 12

Random Pair Generation with Multiple Criteria (index/match)

  1. #1
    Registered User
    Join Date
    05-16-2018
    Location
    toronto
    MS-Off Ver
    2016
    Posts
    6

    Cool Random Pair Generation with Multiple Criteria (index/match)

    Hello everyone,

    I am having an excel formula problem, and it would be greatly appreciated if you could help me out.
    Long story short, here is my attached document.


    I am trying to create a list of random pairs with this criteria:
    Criteria
    1) Two people to be paired up randomly, but
    2) Two people to be from the SAME cluster (Same Cluster Code)
    3) Two people to be from the DIFFERENT department (Different Department Code)
    4) Should be automatic calculation -no manual rand() sorting



    but the problem is, it keeps showing me duplicate. For example,
    If Frederica and Rosie are paired up, then Cristen should not be matched with Rosie, etc.

    Please help!
    Attached Files Attached Files
    Last edited by vankmj; 05-17-2018 at 01:41 PM.

  2. #2
    Registered User
    Join Date
    09-12-2012
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2013
    Posts
    38

    Re: Random Pair Generation with Multiple Criteria (index/match)

    Hi Vankmj

    I'm inclined towards code in this situation, as you need to generate a random option then make sure it fits the criteria. The main issue being unique responses. I'd be going for a loop in vba that made a random selection from the possible matches then have an until match not previously selected.
    can write something up if you need

  3. #3
    Registered User
    Join Date
    05-16-2018
    Location
    toronto
    MS-Off Ver
    2016
    Posts
    6

    Re: Random Pair Generation with Multiple Criteria (index/match)

    Quote Originally Posted by rondeondon View Post
    Hi Vankmj

    I'm inclined towards code in this situation, as you need to generate a random option then make sure it fits the criteria. The main issue being unique responses. I'd be going for a loop in vba that made a random selection from the possible matches then have an until match not previously selected.
    can write something up if you need
    Hello Rondeondon!
    Thank you for your response. That would be amazing if you could help me crack the issue by drafting the code!!!! My vba skill is very basic, so anything would be a great help.

  4. #4
    Registered User
    Join Date
    09-12-2012
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2013
    Posts
    38

    Re: Random Pair Generation with Multiple Criteria (index/match)

    Hi Vankmj

    I'm working on it, the logic is getting a little fiddly. but I think I'm almost there

  5. #5
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,908

    Re: Random Pair Generation with Multiple Criteria (index/match)

    =INDEX([Full Name],MATCH(1,([@[Cluster code]]=[Cluster code])*([@[Dept Code]]<>[Dept Code])
    *(COUNTIF($E$8:E8,[Full Name])=0),0))

  6. #6
    Registered User
    Join Date
    05-16-2018
    Location
    toronto
    MS-Off Ver
    2016
    Posts
    6

    Re: Random Pair Generation with Multiple Criteria (index/match)

    Hello Phuocam ,

    I used your formula, and it seemed to be working for the one time use.
    I want the random match everytime i run the formula, but it seems like one person is stuck with its match forever.
    How can we fix that?
    Last edited by vankmj; 05-24-2018 at 06:06 AM.

  7. #7
    Registered User
    Join Date
    05-16-2018
    Location
    toronto
    MS-Off Ver
    2016
    Posts
    6

    Re: Random Pair Generation with Multiple Criteria (index/match)


  8. #8
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,548

    Re: Random Pair Generation with Multiple Criteria (index/match)

    Here is a possibility.
    The TableMMSummary9 table is appended with a column (which may be hidden using the grouping feature for aesthetic purposes) of randomly generated numbers.
    A second table (2), which could be moved and/or hidden for aesthetic purposes, is populated using the following formula for the first three columns:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Phuocam's formula populates the fourth column.
    The Matched Person's Name column in the TableMMSummary9 table is populated using:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Test by pressing the F9 key.
    Let us know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  9. #9
    Registered User
    Join Date
    05-16-2018
    Location
    toronto
    MS-Off Ver
    2016
    Posts
    6

    Re: Random Pair Generation with Multiple Criteria (index/match)

    Wow jeteMC thank you for your solution
    I have absolutely no clue how the formula works so i think i should spend some time trying to understand - but it seems to be working!

  10. #10
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,548

    Re: Random Pair Generation with Multiple Criteria (index/match)

    You're Welcome and thank you for the feedback. A good way to see what a formula is doing is to select a cell containing the formula and run the Evaluate Formula feature (Formulas tab in the 2010 version). Please take a moment to mark the thread as 'Solved' using the thread tools drop down in the ribbon above your first post. I hope that you have a blessed day.

  11. #11
    Registered User
    Join Date
    05-19-2020
    Location
    aus
    MS-Off Ver
    7
    Posts
    1

    Re: Random Pair Generation with Multiple Criteria (index/match)

    Hey buddy - this spreadsheet worked like a charm. Why does it automatically update whenever i change something. Would you be able to help please?

  12. #12
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,548

    Re: Random Pair Generation with Multiple Criteria (index/match)

    Administrative Note:

    Hello akshat418 and Welcome to Excel Forum.

    We are happy to help, however whilst you feel your request is similar to this thread, experience has shown that things soon get confusing when answers refer to particular cells/ranges/sheets which are unique to your post and not relevant to the original.

    Please see Forum Rule #4 about hijacking and start a new thread for your query.

    If you are not familiar with how to start a new thread see the FAQ: How to start a new thread

    Let us know if you have any questions.

+ 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. Replies: 16
    Last Post: 01-05-2018, 11:04 PM
  2. Need help in Index, Match usage to match multiple criteria in sum function
    By Summer0830 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 03-26-2017, 02:47 AM
  3. Index/Match to Match entries on multiple criteria
    By manning457 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-06-2015, 02:32 PM
  4. [SOLVED] Index Match with Multiple Criteria Using Same Criteria Column
    By rominjn in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-05-2015, 11:34 AM
  5. [SOLVED] Identify the pair and calculate the time difference if certain criteria match
    By Chippi in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 11-10-2014, 07:00 AM
  6. Replies: 2
    Last Post: 09-27-2014, 04:34 PM
  7. Random number generation across multiple ros/columns without repeats
    By Zodeeak in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 08-27-2014, 03:15 PM

Tags for this Thread

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