View Single Post
  #8   Report Post  
Ron Rosenfeld
 
Posts: n/a
Default

On Sun, 24 Apr 2005 14:13:01 -0700, "Homeboy"
wrote:

I wasn't sure what you meant by ambiguity, but now I see your point. As a
practial real world solution, I agree with everything you've said. BUT the
actual situation isn't exactly as I described it. I described it this way
simply to make what sort of formula/function/algorithm I am looking for
clear. In fact, either of the "ambigious" solutions in your example would
work for my situation. Plus the numbers are mostly (but not all) unique.


If ANY solution is acceptable, and there is no need to resolve ambiguities
(which can exist even if all the numbers are unique), you could use Excel's
Solver to find a solution.

For example:
In A1:A60 enter your values.
In B1:B60 enter the number '1'
In C1 enter the formula: =SUMPRODUCT(A1:A60,B1:B60)

Tools/Solver
Set Target Cell: D1
Equal to: Value of: 112 (or whatever)
By Changing Cells:
B1:B60

Subject to the Constraints:
Add
Cell Reference: B1:B60
bin (in the dropdown box)
OK
Solve

Depending on the numbers, you may have to select Options and change the number
of iterations.

After you do the above, the cells adjacent to where B1:B60=1 will sum up to
your payment value.

If you don't see the Solver item on the Tools menu, you may have to add it at
the Tools/Addins and select Solver Addin.



--ron