Formula for the calculation needed to come up with a total
"JoeU2004" wrote:
I wrote:
But I can offer a formula that tells you how many combinations you must
try, if you want to find all combinations of 1 or more numbers.
=sumproduct(combin(10,row(1:10))
Interesting: this is equal to =2^10-1, and more generally =2^n-1.
Well, that shoulda been obvious. Wasn't thinking.
PS: Both formulas assume that there are no duplicate numbers among the 10
(or n), or you want to treat each duplicate number as distinct. For
example, suppose your numbers are 10, 15, 25 and 25, and your target is 50.
You would want 25+25 as a solution. But do you really want two solutions
that are 10+15+25 and 10+15+25?
No the formula can only use the numbers that are there and those only once.
It can't figure it can take 25 twice. If 25 is only entered once that is all
it can use. I would want all possible varibles as long as those numbers are
already entered.
----- original message -----
"JoeU2004" wrote in message
...
"Phillse" wrote:
I need to figure out out of 10 possible numbers which ones
of those 10 equal a specific number.
But your example has 9 numbers ;-).
An example is:
[....]
I need to know what this formula of those numbers would be
to come up with the total of 50.
The answer would be 30 + 20 = 50
So a more precise statement of your problem is: you need know which
combination of 2 or more numbers (1 or more?) sums to the target value.
What if there is more than one combination?
If there a formula that will take that range of number and tell
me which were needed to come up with the total?
I would be surprised if there is such a formula, even for finding just one
combination, other than a formula that invokes a UDF written in VBA.
But I can offer a formula that tells you how many combinations you must
try, if you want to find all combinations of 1 or more numbers.
=sumproduct(combin(10,row(1:10))
Interesting: this is equal to =2^10-1, and more generally =2^n-1.
----- original message -----
"Phillse" wrote in message
...
I need to figure out out of 10 possible numbers which ones of those 10
equal
a specific number.
An example is:
My total is 50.
I have numbers in cells like this
1, 12, 30, 24, 35, 16, 47, 10, 20
I need to know what this formula of those numbers would be to come up
with
the total of 50. The answer would be 30 + 20 = 50
If there a formula that will take that range of number and tell me which
were needed to come up with the total?
Thanks
|