math problem

K

Keven

I have a list of amounts($s). I also have a total. Is there an easy way to
figure out which numbers in my list add up to my total. I dod not know how
many of my numbers are required to get the total.
TIA
 
R

Richard Neville

In the cell showing the total, click in the formula bar at the top of the
page (to the right of fx). The cells included in the total will be
surrounded by colored borders.
 
J

jjbf22

Keven-
If you select the box with te total in it you should see a formula come up
in the formula bar which is up by the toolbars. The formula should look like
this:
Sum( )
In the parentheses it should say which cells have been selectd to be part of
the sum. Good luck.
 
J

jjbf22

What do you mean you need the formula? Is it already giving you a total or
you want to add one yourself?
 
G

Guest

Keven said:
i need the formula. I know how t o use excel t osum


If you're referring to a generic math problem, and not something specific to
Excel, then I believe the answer is that there is no neat closed form solution
to this problem. You have to solve it iteratively, by searching all possible
solutions, which perhaps is where Excel comes in?

First bear in mind that there may be multiple solutions to this problem so you
have to exhaustively check all possible solutions -- you can't just search until
you find one.

One way to do it is to have your numbers in column A and in column B place a
zero or a one. In column C you multiply A * B. Then you sum column C. If the
sum of C does not match the sum you're trying to match, then you have to change
the 1/0 values in B. The obvious way to do this is to make column B a binary
counter and drive it through all it's possible states with a macro.

This will work nicely for "small" problems. The time required to search the
solution space will of course rise exponentially with the number of elements in
column A.

Good luck...

Bill
 
Top