+ Reply to Thread
Results 1 to 7 of 7

Permutations

  1. #1
    Registered User
    Join Date
    05-16-2017
    Location
    Milan
    MS-Off Ver
    2013
    Posts
    3

    Permutations

    Hi everybody.

    I can't find the solution to this problem.

    I have different categories of text data:

    1) Website
    2) Section
    3) Position of the ad
    4) Size of the ad
    5) Type of the ad

    And I would like to find out all possible permutations (I need to insert them in a catalog!) but the structure of any permutation must respect the hierarchy I wrote: I need all permutations where I have:
    Website>Section>Position>Size>Type
    and I don't want other orders
    Section>Type>Website>Position>Size

    For example, if I have:

    1) Website: facetool.com, googland.com
    2) Section: news, travel, love
    3) Position of the ad: top, bottom
    4) Size of the ad: 300x250, 990x250
    5) Type of the ad: standard, special

    I need a list like this:
    facetool.com>news>top>300x250>standard
    facetool.com>news>top>300x250>special
    facetool.com>news>top>990x250>standard
    facetool.com>news>top>990x250>special
    facetool.com>news>bottom>300x250>standard
    facetool.com>news>bottom>300x250>special
    facetool.com>news>bottom>990x250>standard
    facetool.com>news>bottom>990x250>special
    facetool.com>travel>top>300x250>standard
    facetool.com>travel>top>300x250>special
    facetool.com>travel>top>990x250>standard
    facetool.com>travel>top>990x250>special
    facetool.com>travel>bottom>300x250>standard
    facetool.com>travel>bottom>300x250>special
    facetool.com>travel>bottom>990x250>standard
    facetool.com>travel>bottom>990x250>special

    ... and the same for googland.com

    The reality is I have many more websites, sections, positions, sizes and types, that is why I need to automate this. Can you tell me please how can I do it?

    thank you
    zik

  2. #2
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Permutations

    You can do it pretty easily with Power Query. See the attachment for a worked example, which has each individual field and list of values stored in a separate table, then the following query crossjoins them into one output table:

    Please Login or Register  to view this content.
    If your lists of values change, simply update the 'source' tables, then refresh the 'output' table. Simple.
    Attached Files Attached Files
    let Source = #table({"Question","Thread", "User"},{{"Answered","Mark Solved", "Add Reputation"}}) in Source

    If I give you Power Query (Get & Transform Data) code, and you don't know what to do with it, then CLICK HERE

    Walking the tightrope between genius and eejit...

  3. #3
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Permutations

    If you really need all the combinations concatenated and separated by ">", then add one more line to the query:
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    05-16-2017
    Location
    Milan
    MS-Off Ver
    2013
    Posts
    3

    Re: Permutations

    Thank you! But when I update the source tables and then refresh, there is an error message saying something like the initialization didn't work out, check the database server and repeat"

  5. #5
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Permutations

    Did you change the names of the tables, or headers?

  6. #6
    Registered User
    Join Date
    05-16-2017
    Location
    Milan
    MS-Off Ver
    2013
    Posts
    3

    Re: Permutations

    No, I made some changes and now it works,thank you so much, I wish you a good day sir

  7. #7
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Permutations

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. You can also add reputation to those who helped you. Thanks.

+ 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. [SOLVED] Excel 2007 : Three Permutations into one formula
    By Buscador in forum Excel General
    Replies: 14
    Last Post: 05-18-2012, 02:41 PM
  2. Combinations and Permutations
    By curious1201 in forum Excel General
    Replies: 0
    Last Post: 04-19-2012, 05:21 PM
  3. Permutations
    By kajabiwan in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-28-2012, 01:08 PM
  4. Listing permutations
    By bibleguy125 in forum Excel General
    Replies: 3
    Last Post: 02-17-2012, 11:17 AM
  5. Permutations
    By alan73 in forum Excel General
    Replies: 3
    Last Post: 11-07-2011, 06:37 PM
  6. Permutations
    By Christopher_1 in forum Excel General
    Replies: 7
    Last Post: 07-05-2010, 02:28 PM
  7. permutations
    By newyorkjoy in forum Excel General
    Replies: 3
    Last Post: 11-02-2005, 06:17 PM
  8. Permutations
    By RedChequer in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-25-2005, 12:05 AM

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