View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.misc,microsoft.public.excel.programming,microsoft.public.excel.worksheet.functions,microsoft.public.excel.newusers
Harlan Grove
 
Posts: n/a
Default find sum in list of of numbers

Ron Coderre wrote...
Solver isn't a panacea....It's just a nice shortcut for relatively simple
situations without having to find or write code. However, if solver finds
one acceptable solution....couldn't we just create another "flag" field to
prevent the same value from being used more than once?


Perhaps. How would you do that since it's not one value but one
combination of values (OK, a vector of 1s and 0s that could be
considered a single vector value in {0,1}^N) that'd need to be
excluded. As I see it, you'd need to use a kludge like SUMPRODUCT of
the vector of 1s and 0s against 2^(ROW(INDIRECT("1:"&N))-1) to produce
unique identifiers for each solution, save them in a list, then use a
COUNTIF = 0 expression on that list with criteria equal to the current
SUMPRODUCT value. And you'd need to automate storing the idenifiers for
previous solutions, so VBA is unavoidable.

Regarding professional accounting/financial environments, I would hope that
proper internal controls would prevent the situation where a large number of
invoices/checks/whatever would have to be matched (trial and error) against
an amount. Of course there's always the customer who sends a massive check
paying some unknown combination of invoices. Consequently, for those
instances, a phone call to the payee should clear up the confusion
definitively. You wouldn't want to just guess, right?

....

In the real world, reconcilliation of different data sources that
should produce the same results is an unfortunate recurring problem.
And there's often no one to call to get a quick, simple answer.

If a large, multi-solution, iteratave approach cannot be avoided
though....You're right, a vba program would be the way to go.


Yup.