+ Reply to Thread
Results 1 to 4 of 4

Generating 3 variables in a sequence of 10 in all possible permutations

  1. #1
    Registered User
    Join Date
    05-08-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    5

    Generating 3 variables in a sequence of 10 in all possible permutations

    Sorry for the bad wording in the title.

    Could anyone help me generate this set of data.
    I have 3 variables; u, s, d. I need 10 letter sequence using only these in all possible orders.

    Example for a 3 letter sequence:
    u,u,u
    u,u,s
    u,u,d
    u,d,u
    u,s,u
    etc.
    where each letter is in it's own cell.

    Thanks very much!
    Sam

  2. #2
    Forum Contributor amit.wilson's Avatar
    Join Date
    07-09-2013
    Location
    Gotham
    MS-Off Ver
    Excel for Mac 2011
    Posts
    283

    Re: Generating 3 variables in a sequence of 10 in all possible permutations

    Hi Sam,

    hope I'm not working on someone's school assignment. :-)

    Here's how I have thought through the problem. And correct me if I am wrong.

    Say there were 10 letters instead of 3, and we had to generate 1,000 unique combinations. Then the easiest way to generate the permutation would be to write the series of numbers from 0 to 999. And then and substitute the numbers (0,1,2,..9) with the letters.

    To do the same thing with 3 letters, we need a number series with base of 3 (i.e. 0,1,2,10,11,12,20,21,22,...)

    In the attached sheet I've shown how to do this for 20 numbers. Can't do the whole set, the file becomes very heavy and slow. With repetition, there are 3^10 = 59,048 combinations possible.

    Hope this helps.

    Cheers
    Attached Files Attached Files
    <-- If you're happy & you know it...click the star.:-)

  3. #3
    Valued Forum Contributor
    Join Date
    03-21-2013
    Location
    cyberia
    MS-Off Ver
    Excel 2007
    Posts
    457

    Re: Generating 3 variables in a sequence of 10 in all possible permutations

    Sam,

    here's a code to try.
    run it from the VBA editor onto a blank worksheet
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    05-08-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Generating 3 variables in a sequence of 10 in all possible permutations

    Thanks imit.wilson

    And thanks kalak, works a treat!

    Thanks very much for both of your time.

+ 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] Generating Permutations in rows
    By sajeel in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-09-2013, 05:47 AM
  2. Auto generating sequence number
    By DKAbi in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-29-2013, 09:38 PM
  3. Generating Permutations and Combinations
    By e4excel in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 02-25-2011, 03:17 PM
  4. Generating table of permutations of text values
    By bernborough in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-12-2010, 06:00 PM
  5. what is the keyboard shortcut for generating a sequence
    By supreg in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-27-2005, 07:50 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