ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   How to find a find a list of possible inputs to sum a known amt? (https://www.excelbanter.com/excel-discussion-misc-queries/72533-how-find-find-list-possible-inputs-sum-known-amt.html)

JimBunch

How to find a find a list of possible inputs to sum a known amt?
 
I have a known dollar amount and a range of lesser dollar amounts that I need
to find possible sinarios that will add up to the known dollar amount.
Example:

Known Amt = $30
Range of Numbers:
a=$10
b=$10
c=$50
d=$20
e=$30
f=$15
g=$5
possiblilites: (a,d)(b,d)(a,f,g)(b,f,g)(e)

Any ideas?

vezerid

How to find a find a list of possible inputs to sum a known amt?
 

Try this link:
http://tinyurl.com/7j3x2

HTH
Kostis Vezerides

JimBunch Wrote:
I have a known dollar amount and a range of lesser dollar amounts that I
need
to find possible sinarios that will add up to the known dollar amount.
Example:

Known Amt = $30
Range of Numbers:
a=$10
b=$10
c=$50
d=$20
e=$30
f=$15
g=$5
possiblilites: (a,d)(b,d)(a,f,g)(b,f,g)(e)

Any ideas?



--
vezerid
------------------------------------------------------------------------
vezerid's Profile: http://www.excelforum.com/member.php...o&userid=28481
View this thread: http://www.excelforum.com/showthread...hreadid=513997


Bernard Liengme

How to find a find a list of possible inputs to sum a known amt?
 
In A1:G1 enter your values 10,10,50,20,30,15,5
In A2:G2 enter seven 0's
Copy down to row 8
Now in the matrix A2:H8 make the diagonal 1
(eg A2, B3, C4 ... make 1's) ---- this gives us different starting
conditions for Solver
In H2 enter =SUMPRODUCT($A$1:$G$1,A2:G2)
Copy this down to G8
Start Solver; make the Target blank
Make By Changing: A2:G8
Add constraint A2:G8 Bin (binary - we want 0 or 1 in each cell)
Second constraint H2:H8 = 30
Run Solver
I got these answers
$10 $10 $50 $20 $30 $15 $5
1 0 0 0 0 1 1 30
0 1 0 0 0 1 1 30
0 1 0 1 0 0 0 30
0 0 0 0 1 0 0 30
0 0 0 0 1 0 0 30
0 1 0 0 0 1 1 30
0 1 0 1 0 0 0 30


--
Bernard V Liengme
www.stfx.ca/people/bliengme
remove caps from email

"JimBunch" wrote in message
...
I have a known dollar amount and a range of lesser dollar amounts that I
need
to find possible sinarios that will add up to the known dollar amount.
Example:

Known Amt = $30
Range of Numbers:
a=$10
b=$10
c=$50
d=$20
e=$30
f=$15
g=$5
possiblilites: (a,d)(b,d)(a,f,g)(b,f,g)(e)

Any ideas?





All times are GMT +1. The time now is 04:21 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com