+ Reply to Thread
Results 1 to 7 of 7

How to generate a list of pairs for all combination possible?

  1. #1
    Registered User
    Join Date
    01-31-2011
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    5

    How to generate a list of pairs for all combination possible?

    Hi Everyone,

    I would like to generate in Excel a list of all possible pairs from a set list of names.
    Please do you have any idea how to do it? I have Pop Tool added to Excel but I have no ideaof which kind of formula to use.

    For example if my set list is:
    Name 1
    Name 2
    Name 3
    Name 4

    I would like to have, in two columns:
    Column 1 Column 2

    Name 1 Name 1
    Name 1 Name 2
    Name 1 Name 3
    Name 1 Name 4
    ....


    Thank you very much.
    Last edited by Laeticha; 04-13-2012 at 07:34 AM.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: How to generate a list of pairs for all combination possible?

    Here's one way, with names in column A, it will give you a list in C:D:

    Please Login or Register  to view this content.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    01-31-2011
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: How to generate a list of pairs for all combination possible?

    Thanks very much for your answer but I understand nothing. I know a little bit excel but not when it's come to that level.
    Can you explain to me a little bit more in details?
    Thanks very much.

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: How to generate a list of pairs for all combination possible?

    You placed a question in the programming forum, so we presume you are familiar with the basics.

    Follow these instructions to activate your Developer Tab on the Ribbon: http://office.microsoft.com/en-us/ex...010014113.aspx


    How/Where to install the macro:

    1. Open up your workbook
    2. Get into VB Editor (Press Alt+F11)
    3. Insert a new module (Insert > Module)
    4. Copy and Paste in your code (given above)
    5. Get out of VBA (Press Alt+Q)
    6. Save as a macro-enabled workbook

    The macro is installed and ready to use. Select it from the macro list while your list of names is on the activesheet in column A.

  5. #5
    Registered User
    Join Date
    01-31-2011
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    5

    Re: How to generate a list of pairs for all combination possible?

    Thanks very much. After a lot of time I finally get there!
    No I am not used at all of this side of Excel but keen to learn!
    Thanks again, I cam carry on my work now.
    Laetitia

  6. #6
    Registered User
    Join Date
    01-04-2013
    Location
    Norway
    MS-Off Ver
    Excel 2010
    Posts
    1

    Re: How to generate a list of pairs for all combination possible?

    Just what I was looking for! Thank you so much JBeaucaire!!!

  7. #7
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: How to generate a list of pairs for all combination possible?

    UPDATE: Here's another code option that will not use the same name in a single match row and won't do duplicates, all results will be unique pairs.
    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)

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