Excel Question-What totals in a range equal this number?

Is there a way to take a range of numbers and determine which cells and combination of cells (if any) sum to a particular number? For example:

A1=2
A2=4
A3=6
A4=2

I want to know which cells sum to 8. In this case, it would either be A1+A2+A4 or A3+A4. Obviously, this becomes much more difficult when hundreds of numbers are involved.

Any suggestions would be appreciated.

Unspeakably difficult, unless all the numbers are 2.

I can think of no automatic way to determine this using Excel or anything else, for that matter. Noodle it out.

Question: What are you trying to accomplish? Perhaps there’s a different way to get there.

I’m reconciling two groups of numbers, and I have the total difference between the groups. I suspect that the difference is a combination of 2 or more numbers in one of the groups. The problem is finding those numbers, hence, the mystery formula I need.

I cannot think of a way to do it in EXcel but in Basic or any other language it would be a fairly simple, recursive, algorithm.

How about this:

Sort both groups ascending, then compare them side-to-side.