question driving me nuts
Hi,
You can do this with the "Solver" Add-in in Excel (for that, the add-in
should have been installed in Excel. For installing it, "Tools" -- "Add-Ins
....", check "Solver Add-In"; the installation may ask for the Excel or Office
CD)
In Column A enter the denominations as follows:
100 in A2, 50 in A3, 20 in A4,.....1 in A8, 1 in A9, 0.5 in A10, .....0.01
in A14.
In Column B enter the number of each denomination to be used, as follows:
Enter 1 (0 will also be ok) in B2, B3, ..... B14.
In C2 enter the target amount [e.g., 790 or any other amount you want]
In C3, enter the formula =SUMPRODUCT(A2:A14,B2:B14) [calculated total]
In C4, enter the formula =SUM(B2:B14) [total number of bills/coins used]
Invoke "Solver" by doing the following:
"Tools" -- "Solver", and in the 'Solver Parameters' window,
Set Target Cell: $C$4
Equal to: check "Min"
By Changing Cells: $B$2:$B$14
Add the following constraints,by clicking "Add" each time and entering the
following formulas one at a time and clicking "OK"
$B$2:$B$14=integer
$B$2:$B$14=0
$B$2:$B$14<=5
$C$3=$C$2
After all the four constraints have been added click "Solve".
Excel would perform iterations and arrive at the best possible combination
of bills and coins to achieve the target amount.
Regards,
B. R. Ramachandran
"Esaam" wrote:
Okay...I never thought I would ever have to use excel again. Lo and behold, I
am now the owner of a business and have forgotten how to do some things. I
know how to create formaulas for adding and stuff. I forgot how to make my
calculatons so that my deposit would be broken down. For example say I have 5
of each dollar denomination (1,2,5,10,20,50,100) and coin (1,5,10,25,50,$1).
My deposit has to be 790 (5 of each denomination-150).
What I want my sheet to do is tell me how much of each denomination I should
pull out in terms of numbers instead of dollar amount. For exaple instead of
telling me to pull $790 I want it to tell me to pull 5-$100 bills 5-$50 bills
and 4-10 bills. Basically breaking down my cash with the largest possible
denomination until there can be no more. Any help would be deeply appreciated.
|