+ Reply to Thread
Results 1 to 6 of 6

Permutation

  1. #1
    Registered User
    Join Date
    03-26-2012
    Location
    New Jersey, US
    MS-Off Ver
    Excel 2010
    Posts
    22

    Permutation

    Hello All,

    I am trying to figure out permutations (never worked with before). I have two #'s, 0 and 1, and I am trying to understand how many different combinations I can have accross 6 columns.

    Example:

    0,0,0,0,0,0
    0,0,0,0,0,1
    0,0,0,0,1,1
    1,0,0,0,0,0
    1,1,0,0,0,0

    I have tried the combination formula, but for my business needs, order matters. Any assitantce pointing me in the right direction would be appreciated.

    Thanks,
    Alec

  2. #2
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: Permutation

    If you have 6 places then you have 2^7 different combinations = 128 combinations (000000 to 111111)

    You can see them all by, in cell A1 of blank sheet, putting the formula:

    =DEC2BIN(ROW()-1)

    And copying it all the way down to row 128.

    Edited to add: I shouldn't do maths when I'm tired - you'll have 2^6 combinations = 64, so only copy the formula down as far as row 64.
    Last edited by Andrew-R; 12-17-2012 at 07:01 PM.

  3. #3
    Registered User
    Join Date
    03-26-2012
    Location
    New Jersey, US
    MS-Off Ver
    Excel 2010
    Posts
    22

    Re: Permutation

    Hey Andrew,

    Thanks I have never seen the "DEC2" formula before. Interesting way about going about it...but that formula does not have a combination like 0,0,0,0,0,0 or 0,0,0,0,0,1.

  4. #4
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: Permutation

    Sorry, I really wasn't on my best form last night.

    If you change the formula to:

    =DEC2BIN(ROW()-1,6)

    Then you should see all of the combinations you need.

  5. #5
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,604

    Re: Permutation

    And if you want commas between each digit you can do this:

    =LEFT(SUBSTITUTE(SUBSTITUTE(DEC2BIN(ROW()-1,6),"0","0,"),"1","1,"),11)

    then copy down.

    Hope this helps.

    Pete

  6. #6
    Registered User
    Join Date
    03-26-2012
    Location
    New Jersey, US
    MS-Off Ver
    Excel 2010
    Posts
    22

    Re: Permutation

    Andrew/Pete,

    Thanks, yes that gave the required data set. The help is appreciated.

    Happy Holidays.

    -Alec

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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