+ Reply to Thread
Results 1 to 4 of 4

Combination of text in all possible orders

  1. #1
    Registered User
    Join Date
    04-07-2013
    Location
    Isfahan, Iran
    MS-Off Ver
    Excel 2010
    Posts
    5

    Combination of text in all possible orders

    Hi everyone,
    I have a set of n number of names (e.g. Alex, Bruce, Steve, Rob,....) and I want to make a 3 word combination of all possible configurations with one name being in all combinations. In the below example Alex is a text present in all combinations:

    Alex Bruce Steve
    Alex Steve Bruce
    Steve Alex Rob
    Alex Rob Bruce

    Thank you! In Advance

  2. #2
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Combination of text in all possible orders

    How many names are you going to have in total? Even without counting the reversal of names, the number of sets of 3 is going to get very large very quickly. The basic formula to calculate the number of sets for 3 names in a set is

    =n*(n-1)*(n-2) where n is the number of names. If you have 5 names =5*4*3 =60 Four names: =4*3*2 =24

    Are you really sure that you want to do this?
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

  3. #3
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Combination of text in all possible orders

    Actually I think it's slightly less, since the OP wants every return to contain the same name.

    I think it will be:

    =3*PERMUT(A1-1,2)

    where A1=n.

    Regards
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  4. #4
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Combination of text in all possible orders

    The OP shows repetition (first two rows of example) which for this example would yield, I believe 18 sets of 3 names. We don't know how many names there are "I have a set of n number of names".

    A better definition of the problem I think is in order.
    This is how I see the results for the names given with Alex being in each set.

    A
    B
    C
    1
    Alex Bruce Rob
    2
    Alex Bruce Steve
    3
    Alex Rob Bruce
    4
    Alex Rob Steve
    5
    Alex Steve Bruce
    6
    Alex Steve Rob
    7
    Bruce Alex Rob
    8
    Bruce Alex Steve
    9
    Rob Alex Bruce
    10
    Rob Alex Steve
    11
    Steve Alex Bruce
    12
    Steve Alex Rob
    13
    Rob Bruce Alex
    14
    Steve Bruce Alex
    15
    Bruce Rob Alex
    16
    Steve Rob Alex
    17
    Bruce Steve Alex
    18
    Rob Steve Alex


    In any event, I think that I will pass on this.
    Last edited by newdoverman; 01-17-2015 at 02:32 PM.

+ 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 orders log and monthly report for all orders
    By adfo in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-20-2013, 09:39 AM
  2. [SOLVED] sumifs date and text combination
    By ktmjamal in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-14-2013, 12:12 AM
  3. How to Obtain Combination of Different Text Strings
    By clattenburg cake in forum Excel General
    Replies: 2
    Last Post: 10-29-2012, 05:37 PM
  4. Text extraction and re-combination
    By slittlepage in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-06-2009, 03:45 PM
  5. Replies: 5
    Last Post: 03-06-2008, 01:27 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