Using Excel 2010
Hello,
I have 14 number base line which sums are 122 I want to VBA or formula that can generate different all possible combinations which sum as per base line =122.
My 14 numbers base line is in range D7:Q7 which sums are in cell R7=122 and some example combinations are generated manually in range D9:Q13 each line sum match with base line = 122.
Please I need all combinations could be made from base line having rules: in each column of base line add 1 (+1) , or minus (-1), or keep same number to build combination with sum 122
I have asked question under the following link if require can be downloaded example worksheet.
Generate possible combinations but keeping the same sum.
Regards,
Moti
Hello,
I have 14 number base line which sums are 122 I want to VBA or formula that can generate different all possible combinations which sum as per base line =122.
My 14 numbers base line is in range D7:Q7 which sums are in cell R7=122 and some example combinations are generated manually in range D9:Q13 each line sum match with base line = 122.
Please I need all combinations could be made from base line having rules: in each column of base line add 1 (+1) , or minus (-1), or keep same number to build combination with sum 122
Keep Same Sum.xlsm | |||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | |||
5 | |||||||||||||||||||||||||
6 | n1 | n2 | n3 | n4 | n5 | n6 | n7 | n8 | n9 | n10 | n11 | n12 | n13 | n14 | Sum | ||||||||||
7 | 9 | 10 | 11 | 12 | 9 | 7 | 6 | 5 | 9 | 10 | 10 | 8 | 10 | 6 | 122 | <------------- | Example1 My base set of 14 numbers are in D7:Q7….That sum 122 | ||||||||
8 | |||||||||||||||||||||||||
9 | 8 | 9 | 11 | 12 | 9 | 8 | 6 | 6 | 9 | 9 | 9 | 9 | 10 | 7 | 122 | I want a VBA which can make all unique possible combinations from the base line Rules: adding 1 (+1) or subtracting 1 (-1) or keeping the same number in corresponding number of the each columns but total must be the same as the base line in this case 122. Few examples I build manually | |||||||||
10 | 9 | 9 | 11 | 12 | 8 | 7 | 6 | 5 | 10 | 10 | 10 | 9 | 9 | 7 | 122 | ||||||||||
11 | 8 | 10 | 11 | 12 | 9 | 8 | 6 | 6 | 9 | 10 | 9 | 8 | 9 | 7 | 122 | <------------- | |||||||||
12 | 9 | 10 | 11 | 12 | 9 | 8 | 5 | 6 | 10 | 9 | 9 | 9 | 9 | 6 | 122 | ||||||||||
13 | 9 | 9 | 11 | 12 | 9 | 8 | 5 | 6 | 9 | 10 | 9 | 9 | 10 | 6 | 122 | ||||||||||
14 | |||||||||||||||||||||||||
Sheet1 |
Cell Formulas | ||
---|---|---|
Range | Formula | |
R7,R9:R13 | R7 | =SUM(D7:Q7) |
I have asked question under the following link if require can be downloaded example worksheet.
Generate possible combinations but keeping the same sum.
Regards,
Moti