Keven said:
I have a number of values that are $s . I also have a sum of some
of these numbers. I need a formula to figure out which numbers add
to my total. I do not know how many numbers will equal my total.
In general, there is no closed-form formula for this -- only
alogithms. And of course, there can be multiple answers, unless
you restrict the solution space further (e.g, "find the largest
numbers that sum to the desired total"). In fact, it would be
good if you can restrict the solution space. Otherwise, the
algorithm must look at all possible sums of 1, 2, ... up to N
numbers. That can be a staggering number, depending on the size
of N (although some combinations will be truncated once an
overflow occurs).
I would not think Excel is the best tool for solving this problem,
although I guess VBA can be used to solve any problem that
requires a programming language.
(Hmm, does VBA support recursion?)