Closed Thread
Results 1 to 4 of 4

Formula to combine 2 columns

  1. #1
    Registered User
    Join Date
    07-22-2015
    Location
    There
    MS-Off Ver
    2013
    Posts
    6

    Unhappy Formula to combine 2 columns

    Hello,

    I'm total newbie regarding excel formula. I have the following table:

    A B C
    Andorra AD
    Belgium BE
    Bulgaria BG
    Cyprus CY
    Denmark DK
    England EN
    Finland FI
    France FR
    Germany DE
    Greece GR
    Italy IT
    Netherlands NL
    Poland PL
    Portugal PT
    Spain ES
    Sweden SE

    I'm trying to write a formula to generate a matrix representing all the possible travels : Travel from A to A, from A to B, from B to A, and from B to B. The only restriction is not to travel from a country to itself.

    At the end I want to generate the result in a single column C, like this :

    Travel from Belgium to Andorra
    Travel from Belgium to England
    Travel from Belgium to France
    Travel from Belgium to Germany
    Travel from Belgium to Netherlands
    Travel from Belgium to Italy
    Travel from Belgium to Spain
    Travel from England to Belgium
    Travel from England to France
    Travel from England to Germany
    Travel from England to Netherlands
    Travel from England to Italy
    Travel from England to Spain
    etc
    Travel from Belgium to AD
    Travel from Belgium to EN
    Travel from Belgium to FR
    Travel from Belgium to DE
    Travel from Belgium to NL
    etc
    Travel from BE to EN
    Travel from BE to FR
    Travel from BE to DE
    etc
    Travel from BE to England
    Travel from BE to France
    etc

    Can anyone help me with that ? I tried several tricks with concatenation, but I don't get anywhere ...

    Thanks a lot in advance!

    Book1.xlsx
    Last edited by yopl; 07-22-2015 at 03:31 PM.

  2. #2
    Forum Expert daffodil11's Avatar
    Join Date
    07-11-2013
    Location
    Phoenixville, PA
    MS-Off Ver
    MS Office 2016
    Posts
    4,465

    Re: Formula to combine 2 columns

    This is an application that run much faster with code. Permutations is hard work.

    Please Login or Register  to view this content.
    This little snippet just runs through each cell and smooshes it with another cell as long as they aren't on the same row.

    To use this, simply go to Excel and hit Alt+F11, go to Insert->Module and paste the code there. Hit the play button or F5 to initiate.
    Make Mom proud: Add to my reputation if I helped out!

    Make the Moderators happy: Mark the Thread as Solved if your question was answered!

  3. #3
    Registered User
    Join Date
    07-22-2015
    Location
    There
    MS-Off Ver
    2013
    Posts
    6

    Re: Formula to combine 2 columns

    Thank you so much for your time, but I specifically need help on excel formula on this one

  4. #4
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,596

    Re: Formula to combine 2 columns

    This is duplicated thread and closed on user request.
    You can continue at Commercial Services.

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Macro to combine multiple columns keeping few columns specific
    By lramesh in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-16-2013, 12:44 PM
  2. [SOLVED] Vlookup (or other formula) that will combine 2 columns into 1
    By Marcel Coetzee in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-04-2013, 06:20 PM
  3. MAcro to - copy, transpose, text to columns, remove column A, combine all columns in 1
    By galvinpaddy in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 02-07-2013, 08:48 AM
  4. formula to combine data in rows and columns
    By crazytrain in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-26-2012, 05:58 PM
  5. [SOLVED] Formula to combine two columns in a specific way?
    By chemoul in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-08-2012, 03:23 AM
  6. Replies: 1
    Last Post: 02-13-2012, 08:08 PM
  7. Replies: 14
    Last Post: 04-10-2009, 03:28 AM
  8. Replies: 0
    Last Post: 07-31-2006, 12:13 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