+ Reply to Thread
Results 1 to 5 of 5

How to find matching pairs meeting certain conditions?

  1. #1
    Registered User
    Join Date
    11-26-2012
    Location
    Helsinki, Finland
    MS-Off Ver
    Excel 2007
    Posts
    7

    How to find matching pairs meeting certain conditions?

    I would like to find matching pairs. If you have two tables - table1 with for sets of data (I, II, III, IV) with every data set containing five variables (Var1, Var2, Var3, Var4, Var5), and table2 with four sets of conditions (A, B, C, D) for every data set to match. Now, I want to make a macro to find a matching unique set of conditions in table2 for every unique set of data in table1, and this solution could be output in table3 (like for example: AIII, BI, CIV, DII).

    Table2: set of conditions with its five variables:
    A: 0; 4; Green; No; Number between 1 and 100
    B: 1; 6; Red or Black; Yes; <90
    C: 0; 8; White or Blue; No; >75
    D: 1; 3; Red; Yes; Number between 50 and 79

    Table1: set of data with its five variables:
    I: 1; 6; Red; Yes; 77
    II: 1; 3; Red; Yes; 55
    III: 0; 4; Green; No; 65
    IV: 0; 8; Blue; No; 80

    The problem is solved only when pairs are formed for every set of data and every set of conditions. So, each set is used only once.

    There could be more than one solution how to form pairs between the sets of data and sets of conditions. So more sulutions could be output in table4, table5, table6, and so forth.

    Now for this to be useful to me I need to be able to extend this macro for using 150-200 sets of data and the same amount of conditions, and perhaps 20 variables for every set.

    I would be very happy for some help here.

  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 find matching pairs meeting certain conditions?

    HI MoreExcel,

    Can you upload an excel workbook to avoid any data layout misunderstanding ?
    also mention your expected output as well... thanks.


    Regards,
    DILIPandey
    <click on below * if this helps>
    DILIPandey, Excel rMVP
    +919810929744 (India), +971528225509 (Dubai), [email protected]

  3. #3
    Registered User
    Join Date
    11-26-2012
    Location
    Helsinki, Finland
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: How to find matching pairs meeting certain conditions?

    Hello dilipandey,

    I now upload an Excelsheet with the sample tables.

    Thank you for showing interest in my problem.

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

    Re: How to find matching pairs meeting certain conditions?

    HI MoreExcel,

    See the attached file where I used below formula to find out the desired results:-

    Formula: copy to clipboard
    Please Login or Register  to view this content.



    Data meeting certain conditions or matching data set with condition set.xlsx

    Regards,
    DILIPandey
    <click on below * if this helps>

  5. #5
    Registered User
    Join Date
    11-26-2012
    Location
    Helsinki, Finland
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: How to find matching pairs meeting certain conditions?

    Hello dilipandey,

    Your formula is very interesting and clever, and I think I have use for it in my further work.
    Thank you for helping me.

    P S Sorry for answering so late

    Regards,
    MoreExcel

+ 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