ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Can solver do this? (https://www.excelbanter.com/excel-worksheet-functions/35282-can-solver-do.html)

chrisrowe_cr

Can solver do this?
 

Hi everyone, im new here. I have a reasonable knowlege of Excel, but my
question emphasises a gap in my knowledge!

ok, wondering if and how the solver function could achieve this:

list of numbers...

23
43
51
27
19
28

etc....

I want to find say for example the numbers that add upto 79 in that
list, can solver find which of the numbers ie 43+17+19 do so?


--
chrisrowe_cr
------------------------------------------------------------------------
chrisrowe_cr's Profile: http://www.excelforum.com/member.php...o&userid=25220
View this thread: http://www.excelforum.com/showthread...hreadid=387084


David Jessop

Hi,

Yes it can. Put the numbers you have in a column and add a column of zeros
next to them, and calculate =SUMPRODUCT () between the two. This becomes the
target cell for solver.

The cells to change are the columns of zeros and then you "just" have to add
the constraint that each of these is binary.

Finally, set solver to do Equal to Value of 79 in your example.

In this case I get the solution 51 + 28 btw!

HTH,

David

"chrisrowe_cr" wrote:


Hi everyone, im new here. I have a reasonable knowlege of Excel, but my
question emphasises a gap in my knowledge!

ok, wondering if and how the solver function could achieve this:

list of numbers...

23
43
51
27
19
28

etc....

I want to find say for example the numbers that add upto 79 in that
list, can solver find which of the numbers ie 43+17+19 do so?


--
chrisrowe_cr
------------------------------------------------------------------------
chrisrowe_cr's Profile: http://www.excelforum.com/member.php...o&userid=25220
View this thread: http://www.excelforum.com/showthread...hreadid=387084



MrShorty


David's method works just fine for finding any solution. As David
hinted, you may need to add other constraints or definition to the
problem is you want to find a specific solution or find all possible
solutions.


--
MrShorty
------------------------------------------------------------------------
MrShorty's Profile: http://www.excelforum.com/member.php...o&userid=22181
View this thread: http://www.excelforum.com/showthread...hreadid=387084



All times are GMT +1. The time now is 06:22 AM.

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