+ Reply to Thread
Results 1 to 4 of 4

Create paired combinations based on values in two columns

  1. #1
    Registered User
    Join Date
    05-28-2009
    Location
    Oxford
    MS-Off Ver
    Excel 2007
    Posts
    86

    Create paired combinations based on values in two columns

    I'm trying to create unique pairings based on values in two columns. The first column acts as a unique key and I want to pair corresponding values in the second column. Only unique pairings are required - not all possible combinations.

    My range is currently A2:B7000 on a low spec machine so processing needs to be as minimal as possible.

    Many thanks.


    bookexample2.xlsx
    Last edited by Knawl; 12-22-2015 at 12:46 PM.

  2. #2
    Forum Expert
    Join Date
    06-26-2010
    Location
    Austin, TX
    MS-Off Ver
    Excel 2010
    Posts
    1,673

    Re: Create paired combinations based on values in two columns

    Thanks for the attachment, as it adds some examples, but it still leaves some questions:
    1 - you state 'pairings,' yet I see some with two 'variables' (e.g. G2:H2) and others with three variables (e.g. G3:I3). What do you consider to be a 'pairing'?
    2 - Is there a quantity of unique pairings you want?

    Certainly, a macro can be written to do this, but probably the easiest way would be to just do some random picks using the INDEX function. Then copy and paste values those random values, then use the data tool to remove duplicates so that you are left with unique values. Since there may be some duplicates removed, start out with a bit more than you need during the random picking. You could even record a macro to do what I described, and it would probably be fairly quick.
    Pauley
    --------
    If I helped with your issue, I'd appreciate a rep bump (hit the '*' icon to the bottom left of this post).

  3. #3
    Registered User
    Join Date
    05-28-2009
    Location
    Oxford
    MS-Off Ver
    Excel 2007
    Posts
    86

    Re: Create paired combinations based on values in two columns

    Hi Pauleyb,

    I'm not explaining this very well. 1 appears once in the list on the left and 2 appears three times. Pairings only need to be established for fruits with the corresponding same number. If there is no pair then the first value goes into the first result column without a pairing.

    The idea is that if Apple, Orange and Tangerine all have a value of 1 then that is telling us that they are all linked.

    Apple is linked to Orange
    Apple is linked to Tangerine
    Orange is linked to Apple
    Orange is linked to Tangerine
    Tangerine is linked to Apple
    Tangerine is linked to Orange

    However the ones in red already have their link established in the above three. The desired formula or VBA could either contain or not contain the ones in red. It doesn't matter.

    I hope this helps and many thanks.
    Last edited by Knawl; 12-23-2015 at 04:25 AM.

  4. #4
    Forum Expert
    Join Date
    06-26-2010
    Location
    Austin, TX
    MS-Off Ver
    Excel 2010
    Posts
    1,673

    Re: Create paired combinations based on values in two columns

    Sorry for the delay, Christmas got me.

    I think you will need a macro for this. I recommend you repost with the clarification of what you want in the 'macros' group of this site.

+ 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. create random combinations from two columns
    By hansom0801 in forum Excel General
    Replies: 2
    Last Post: 10-08-2015, 08:15 AM
  2. create a table based on values selected in rows and columns
    By hemagala in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-14-2015, 03:46 AM
  3. Create and index/list based on the values on 2 columns
    By Erik913 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 09-01-2014, 09:15 PM
  4. [SOLVED] Create list of combinations based on changing criteria
    By NamiSama in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-15-2014, 01:41 PM
  5. Create all 2,3,4,5 etc combinations of columns out of X number of columns
    By sans in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-11-2012, 03:51 PM
  6. Create 2 columns and populate variable data combinations
    By Pete123abc in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-18-2011, 12:35 PM
  7. Replies: 0
    Last Post: 06-02-2006, 12:10 PM

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