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

Just for the record, Harlan, I wholeheartedly agree with everything you et
al have mentioned regarding cross-matching details to totals. These
scenarios rarely have an elegant solution....having been there and done that
during the 12 years I spent as a financial/accounting manager. I never once
considered Solver more than a shot-in-the-dark approach to try first, just
in case. The basic problem is huge! After all, it took someone with your
intellectual horsepower to finally come up with code that has a reasonable
shot at dealing with the issue.

Unfortunately, the best defense is to try to do everything feasible to avoid
the situation and hope the worst case never happens.

Regards,
Ron

"Harlan Grove" wrote in message
ups.com...
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.