+ Reply to Thread
Results 1 to 14 of 14

Excel permutations word generator

  1. #1
    Registered User
    Join Date
    07-26-2012
    Location
    Paramus, NJ
    MS-Off Ver
    2010
    Posts
    14

    Question Excel permutations word generator

    I have the following list in an excel sheet

    Column A
    Red
    Green
    Blue
    White
    Black

    Question : I’m looking for a script of some kind that will create a permutation of all these words that’s possible without repeating. However, with minor thing the items of red and green must be included in each permutation, so for example two possibilities could. :

    red + green + blue
    red + green + black
    We should never get an example like this: blue + white + black. This is because red + green isn’t included.
    Last edited by Tonx; 11-24-2021 at 06:48 PM.

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Excel permutations word generator

    That is extremely easy to create.

    How do you want the output?


    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by mehmetcik; 11-24-2021 at 07:21 PM.
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  3. #3
    Registered User
    Join Date
    07-26-2012
    Location
    Paramus, NJ
    MS-Off Ver
    2010
    Posts
    14

    Re: Excel permutations word generator

    I was looking to have the outlook to be in a list that shows all the output at once with red and green also being the first two.
    And to also show all possible combo.....so the string could be up to 5
    Last edited by Tonx; 11-24-2021 at 09:25 PM.

  4. #4
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,463

    Re: Excel permutations word generator

    Are the real items not "colour"? try to post actual sample. its might be not hard to extract a combination list, I think.
    Quang PT

  5. #5
    Registered User
    Join Date
    07-26-2012
    Location
    Paramus, NJ
    MS-Off Ver
    2010
    Posts
    14

    Re: Excel permutations word generator

    Not combination list, but the above is the exact things…..it’s all colors.

  6. #6
    Valued Forum Contributor
    Join Date
    12-14-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2007
    Posts
    439

    Re: Excel permutations word generator

    Try this
    Please Login or Register  to view this content.
    ❖ Please mark your thread is SOLVED if there has been offered a solution that works fine for you.

    ❖ If you like solutions provided by anyone, feel free to add reputation by clicking on ✶ Add Reputation bottom left of their posts.

  7. #7
    Registered User
    Join Date
    07-26-2012
    Location
    Paramus, NJ
    MS-Off Ver
    2010
    Posts
    14

    Re: Excel permutations word generator

    this so super helpful! thanks so much...one more question.....how could I apply a check to ensure that the list are unique so they repeat in different order?

    mean red+ green + blue ---> is the same as blue + red + green .......so wouldn't want this

  8. #8
    Valued Forum Contributor
    Join Date
    12-14-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2007
    Posts
    439

    Re: Excel permutations word generator

    Did you mean you want to list the combinations, not permutations? If right, only seven groups meet the condition:
    • Red + Green + Blue
    • Red + Green + Blue + White
    • Red + Green + Blue + White + Black
    • Red + Green + Blue + Black
    • Red + Green + White
    • Red + Green + White + Black
    • Red + Green + Black

  9. #9
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,463

    Re: Excel permutations word generator

    Quote Originally Posted by Tonx View Post
    this so super helpful! thanks so much...one more question.....how could I apply a check to ensure that the list are unique so they repeat in different order?
    mean red+ green + blue ---> is the same as blue + red + green .......so wouldn't want this
    Lots of cases like:Attachment 756931

    Is it acceptable?

  10. #10
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,463

    Re: Excel permutations word generator

    Correct me if I misunderstanding you:
    "Red+Green" always present at beginning
    For each Black, Blue, White (1,2,3)
    Red+Green+color1
    Red+Green+color1+color2
    Red+Green+color1+color3
    Red+Green+color1+color2+color3

    4 cases for color1. Similar to color 2 and 3

    Total: 4*3=12 cases of combination.
    Attached Images Attached Images

  11. #11
    Registered User
    Join Date
    07-26-2012
    Location
    Paramus, NJ
    MS-Off Ver
    2010
    Posts
    14
    Quote Originally Posted by huuthang_bd View Post
    Did you mean you want to list the combinations, not permutations? If right, only seven groups meet the condition:
    • Red + Green + Blue
    • Red + Green + Blue + White
    • Red + Green + Blue + White + Black
    • Red + Green + Blue + Black
    • Red + Green + White
    • Red + Green + White + Black
    • Red + Green + Black
    Yes this is exactly what I mean. Sorry I got my wording wrong

  12. #12
    Registered User
    Join Date
    07-26-2012
    Location
    Paramus, NJ
    MS-Off Ver
    2010
    Posts
    14
    Quote Originally Posted by bebo021999 View Post
    Correct me if I misunderstanding you:
    "Red+Green" always present at beginning
    For each Black, Blue, White (1,2,3)
    Red+Green+color1
    Red+Green+color1+color2
    Red+Green+color1+color3
    Red+Green+color1+color2+color3

    4 cases for color1. Similar to color 2 and 3

    Total: 4*3=12 cases of combination.
    This is exactly what I actually mean

  13. #13
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,463

    Re: Excel permutations word generator

    PHP Code: 
    Sub test()
    Dim myArr() As String
    Set myCol 
    = New Collection
    myArr 
    Split("+Blue,+White,+Black,+Blue,+White"",")

    For 
    1 To 3
        myCol
    .Add myArr(1)
        
    myCol.Add myArr(1) & myArr(i)
        
    myCol.Add myArr(1) & myArr(1)
        
    myCol.Add myArr(1) & myArr(i) & myArr(1)
    Next
    For 1 To myCol.Count
    Cells
    (i1).Value "Red+Green" myCol(i)
    Next

    End Sub 
    Attached Images Attached Images

  14. #14
    Registered User
    Join Date
    07-26-2012
    Location
    Paramus, NJ
    MS-Off Ver
    2010
    Posts
    14

    Re: Excel permutations word generator

    checking now

+ 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. Replies: 6
    Last Post: 02-20-2019, 12:47 AM
  2. Random word generator
    By shorie7 in forum Excel Formulas & Functions
    Replies: 19
    Last Post: 07-11-2016, 10:18 AM
  3. Dynamic Word List Generator
    By ar5d in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-03-2014, 07:01 PM
  4. Random Word Generator from Dictionary
    By jzg in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-17-2014, 05:33 PM
  5. [SOLVED] Random word generator for learning
    By randomcow in forum Excel General
    Replies: 12
    Last Post: 02-01-2013, 07:44 AM
  6. random word generator
    By shadowplay in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-31-2010, 07:52 AM
  7. Random word generator
    By zealot in forum Excel General
    Replies: 3
    Last Post: 08-13-2010, 06:06 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