BobbyJones,

Such an algorithm would make use of Combinatorics (math). For x numbers the number

of choices (how many ways) grows as a factor of x! as x grows. This number gets big

fast. When not all number make the sum but only a subset, the value grows fast yet a

somewhat slower rate of x! k! / (k-x)! x!.

FYI the value x! (Factorial) is the product of each number from 1 to x.

So a brute force algorithm would be to write a VBA macro that counts down from x to 1

sequentially, indexing an array of your list of numbers (choices). Then by adding

incrementally the choices of the contents of the array to meet the sum. This method will

take longer than time itself for any values of x greater than say 10.

One suggestion would be how to throw out choices by comparing each choice to be less

than the sum. You would skip the choices greater. This would allow for say 6 out 30

numbers to be doable and not lock up your machine with endless processing.

As for the utility of doing such a thing, I can not comment on accounting. I would say

though this method does work for code breaking - though the numbers are usually

prime numbers (numbers only divisible by 1 and itself).

Hope this helps.

maddog