Hi All,
Looking for an Excel solution (I have Excel 2010-Mac) to the following problem:
I have a list of 20,000 numbers (deciphering bioinformatics data) and would like to have a formula that would be able to perform a Sum to a specific number and then tell me how many cells were used to reach that Sum.
For a better understanding, lets say that my list of numbers is arranged from high-to-low (this is how it would normally be set-up):
10,000
3,000
500
500
300
250
250
200
175
150
50
10
1
1
1
And I specified that I want a Sum = 14,100 (but not greater than). How would I write a formula to both calculate a sum (using numbers from high-to-low) and then also tell me how many of the numbers were used to reach that sum. The Sum does not have to perfectly equal the number I specify, just as close as possible without being greater than the specified number. In this case, the formula should report back that 4 cells were used to reach a Sum of 14,000.
Also, a real bonus would be if I could sum an entire set of numbers and then be able to specify the decile percentages (say by 10% increments) and then have a sum function that Sum to each of the decile percentages and tell me how many numbers were used to reach that decile number.
For example: let's say that I have a total of 10,000 individual numbers that when Sum = 300,000 and that I want to set-up deciles by 10% increments so that the Top 90% =30K, Top 80% = 60K, Top 70% = 90K, etc. How would I write a formula that would tell me how many of the cells were required to reach (but no exceed) from my ranked high-to-low list of 10,000 numbers the desired number, i.e., 30K, 60K, 90K, etc.
Any help would be greatly appreciated.
If this works, I would certainly include you as an acknowledgement in any publication of the scientific data.
Thanks!
Mark
Looking for an Excel solution (I have Excel 2010-Mac) to the following problem:
I have a list of 20,000 numbers (deciphering bioinformatics data) and would like to have a formula that would be able to perform a Sum to a specific number and then tell me how many cells were used to reach that Sum.
For a better understanding, lets say that my list of numbers is arranged from high-to-low (this is how it would normally be set-up):
10,000
3,000
500
500
300
250
250
200
175
150
50
10
1
1
1
And I specified that I want a Sum = 14,100 (but not greater than). How would I write a formula to both calculate a sum (using numbers from high-to-low) and then also tell me how many of the numbers were used to reach that sum. The Sum does not have to perfectly equal the number I specify, just as close as possible without being greater than the specified number. In this case, the formula should report back that 4 cells were used to reach a Sum of 14,000.
Also, a real bonus would be if I could sum an entire set of numbers and then be able to specify the decile percentages (say by 10% increments) and then have a sum function that Sum to each of the decile percentages and tell me how many numbers were used to reach that decile number.
For example: let's say that I have a total of 10,000 individual numbers that when Sum = 300,000 and that I want to set-up deciles by 10% increments so that the Top 90% =30K, Top 80% = 60K, Top 70% = 90K, etc. How would I write a formula that would tell me how many of the cells were required to reach (but no exceed) from my ranked high-to-low list of 10,000 numbers the desired number, i.e., 30K, 60K, 90K, etc.
Any help would be greatly appreciated.
If this works, I would certainly include you as an acknowledgement in any publication of the scientific data.
Thanks!
Mark