+ Reply to Thread
Results 1 to 3 of 3

Permutation function problem

  1. #1
    Registered User
    Join Date
    01-16-2009
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    1

    Permutation function problem

    Hello,

    I am trying to create a function that populates a worksheet with a list of various permutations of a "Total" number.

    I have the following fields

    The only known entity is TOTAL = A + B + C
    Total (T) will be a number from 1 to 30
    Variable (A) must be at least 1 and can be equal to Total
    Variable (B) and (C) can be 0 or any numbers added to VariableA to equal Total
    This is an example of the result I am looking to achieve, but (T) must go all the way to 30, with all the possible permutaions of A + B + C.

    T A B C
    1 1 0 0
    2 2 0 0
    2 1 1 0
    2 1 0 1
    3 3 0 0
    3 2 1 0
    3 2 0 1
    3 1 2 0
    3 1 1 1
    3 1 0 2
    etc


    Any help in the right direction would be much appreciated.

    Many thanks


    Paul

  2. #2
    Registered User
    Join Date
    05-02-2004
    MS-Off Ver
    2007
    Posts
    43
    You can do that quite easily with 3 nested loops and a calculation for C

    For T = 1 to 30
    For A = 1 to T
    For B = 0 to (T-A)

    TJ

  3. #3
    Registered User
    Join Date
    12-20-2008
    Location
    US
    MS-Off Ver
    Excel 2007, Student Version
    Posts
    33
    Excel 2007
    Here is a method for finding sums of combinations
    for a limited range of Combin(n,m).
    Modify code for Permut(n,m) but risk
    running out of space and time.
    http://www.mediafire.com/file/0neyej...um_Combin.xlsm
    Last edited by herbds7; 01-16-2009 at 04:50 PM. Reason: no link

+ 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