Solved
Sum Combination Algorithm - Friday Afternoon Puzzle!!
Posted on 2004-10-15
Hi,
Any expert out there ....
I am looking for an algorithm for a VBA-Excel-program.
I have 8 different numbers in an excel spreadsheet row in cells a1,b1,c1,d1,e1,f1,g1,h1 - the number being 10,2,5,6,7,4,1,12
The algorithm should now give all combinations for all the sums i.e. the sum of all 8 numbers, the sum of 7 number in all combinations, sum of 6 numbers in all combinations ..... sum of 2 numbers in all combinations etc
There should be a total of 255 sum combinations, the sum combination being as follows:
Combinations
Sum 8 from 8 1
Sum 7 from 8 8
Sum 6 from 8 28
Sum 5 from 8 56
Sum 4 from 8 70
Sum 3 from 8 56
Sum 2 from 8 28
Sum 1 from 8 8
Total Combinations 255