I need to create a spreadsheet where I will enter several (17) different numbers and have all possible combinations of sums between them. For example 1,2,3,4.....:
1+2
1+3
1+4
2+3
2+4
3+4
.....
It will be great if I can also know which two numbers the combinations come from.
If all you need are pairs of values, then use this simpler macro:
If A2:A18 had the 17 numbers,
B1(heading):
B2:
This will give a 17*17 table of SUM of all different combinations:
This is for Excel using VBA
List your 17 values in A1 through Q1. Then run this macro:
The combinations will appear from B4 downwards and the associated sums in column D:
Adapted from John Coleman's code.
Post
NOTE:
This took about 4 minutes to run on my old laptop.