Finding combinations to match a total

  • Thread starter Thread starter Jack Sheet
  • Start date Start date
J

Jack Sheet

A range contains a list of numbers (one number per cell), in no particular
order (although if important it could be sorted). There are no blank cells
nor text cells within the range.

It is desired to identify those items in the list which add up to a
specified total.
There could be more than one solution, ie several combinations that add up
to that total, or there might be no solution. Where there is more than one
solution I would ideally like to have a report that lists all of the
solutions. Failing that, the next best option would be one that lists the
first found solution with a prompt to search for the next (if any). Failing
that it might be acceptable to have a report that just produces the first
identified solution.

I suppose that ideally I should be permitted to round the sum to a specified
precision prior to comparison with the target total, if only to avoid those
common rounding errors at the 15th significant figure. Alternatively I
might like to specify a range of values within which the sum should fall
(rather than a single target sum).

Somehow I suspect that something along these lines is a wheel that has
already been invented, if only because it would be a very useful utility in
practice. Anyone out there know of anything like this?
 
Back
Top