+ Reply to Thread
Results 1 to 4 of 4

Create lists of all possible pair combinations (excluding repeats) from cells in every row

  1. #1
    Registered User
    Join Date
    08-04-2012
    Location
    London, England
    MS-Off Ver
    Office 365 64 bit
    Posts
    6

    Question Create lists of all possible pair combinations (excluding repeats) from cells in every row

    I have a spreadsheet with around 50,000 rows. Each row contains a list of values across multiple columns that are associated with each other (like attendees at a party).

    I'd like to turn each row into a new list that combines the cells in that row into every possible paired combination, like this:

    combinaitons-example.PNG

    In effect, the result is showing how every cell in each row can be combined in pairs without repeats (i.e. 1,2 can represent 2,1 without needing to actually list 2,1).

    • The number of values in each row differs, ranging from 3 to 10
    • As shown in the screenshot and attached example spreadsheet, I'd like the solution to stack each list, preferably in a new spreadsheet to maximize the number of available rows before hitting memory limits

    Many thanks for any help you can provide!
    Attached Files Attached Files

  2. #2
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,230

    Re: Create lists of all possible pair combinations (excluding repeats) from cells in every

    Please Login or Register  to view this content.
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

  3. #3
    Registered User
    Join Date
    08-04-2012
    Location
    London, England
    MS-Off Ver
    Office 365 64 bit
    Posts
    6

    Re: Create lists of all possible pair combinations (excluding repeats) from cells in every

    Thanks, sintek. That works perfectly, although when I run it on many thousands of rows it gives a subscript out of a range error, highlighting 'x = x + 1: Temp(x, 1) = Arr(ii):'. But maybe this is due to blank cells or something? Either way, the code you supplied I can certainly work with so I'll mark as solved and add reputation. Thanks.

  4. #4
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,230

    Re: Create lists of all possible pair combinations (excluding repeats) from cells in every

    Play around with value in red...
    Please Login or Register  to view this content.

+ 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. VB script to create different combinations based on a list - no repeats
    By Tonx in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-15-2020, 11:19 AM
  2. Random Lists with no Repeats
    By cliff2017 in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 01-29-2017, 02:03 PM
  3. Replies: 5
    Last Post: 01-23-2017, 12:05 PM
  4. Finding first five items in a pair of lists under specific conditions
    By david.aukerman in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-13-2013, 11:27 AM
  5. Replies: 1
    Last Post: 06-14-2013, 04:06 PM
  6. [SOLVED] Create a list excluding cells with a certain value
    By bluehour84 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 10-04-2012, 02:33 PM
  7. Unigue combinations of a set of numbers w/ no repeats
    By jeremy3721 in forum Excel General
    Replies: 8
    Last Post: 11-02-2007, 10:09 AM

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