Best Combination for the Price

dclasen

New Member
Joined
Dec 4, 2012
Messages
21
I'm trying to determine a way (maybe without VBA) to find the best combination of product for the price.
It seems like this Knapsack formula I did some research on, but I was hoping for something in the existing formulas/solvers available standard in Excel. Any help is appreciated.

open
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
The link isn't helping me much in understanding your question.

I see controller type, presumably the first column is the different types of controller, A,B, C, D, E with the other columns being the various features of that particular controller, including cost in Column H.

Your Desired Amount row shows how many controllers with what features are desired.

But your desired result leaves me confused. Your Desired Amount row calls for a total of 10 controllers.
But your expected result (1 each A & B, 1 each E & B) totals to only 4 controllers.
 
Last edited:
Upvote 0
I see - there are 5 controllers (A-E). The columns are characteristics of the controllers, including the cost.
Therefore, Controller A has 8UI, 2DI, 2AO, 4DORelay, 4DO Triac

If I'm looking for (Desired) 9UI and 1AO - it means I need to select two controllers to get >= UI and still provide at least 1 AO.

When you look at price A and E are the same price so this is why the lowest cost result was two possible combinations.
 
Last edited:
Upvote 0
A​
B​
C​
D​
E​
F​
G​
H​
I​
J​
3​
Type​
UI​
DI​
Pressure​
AO​
DO Relay​
DO Triac​
Cost​
Qty​
4​
A​
8​
2​
0​
2​
4​
4​
$ 2.00​
1​
5​
B​
8​
12​
0​
0​
0​
0​
$ 1.00​
1​
6​
C​
6​
0​
0​
6​
5​
0​
$ 3.00​
0​
7​
D​
8​
2​
0​
2​
4​
4​
$ 4.00​
0​
8​
E​
7​
0​
1​
4​
5​
2​
$ 2.00​
0​
9​
Avail / Cost
16​
14​
0​
2​
4​
4​
$ 3.00​
B9 and across: =SUMPRODUCT(B4:B8, $I$4:$I$8)
10​
Req'd
9​
0​
0​
1​
0​
0​


Use Solver (engine Simplex LP) to minimize H9 by changing I4:I8 subject to the constraints:

I4:I8 >=0

I4:I8 integer

B9:G9 >= B10:G10

It will give only a single solution.
 
Last edited:
Upvote 0
So the problem is
Find combinations of ABCDE such that the sum of their characteristics (UI, DI, etc) meets or exceeds the desired characteristics list

And then choose the combination(s) that have minimum total price.

Is that the problem?
 
Upvote 0
One more question.
Are the number or characteristics fixed?
I'm guessing that there might be more than 5 controller types(A,B,C,D,E) in actual situation, but will there be more than the 5 listed characteristics (UI, DI, etc.)?
 
Last edited:
Upvote 0
First question is yes.
The controller characteristics are fixed so there are only five types.
EDIT: Actually, the next things to figure out is the option to use UI as DI or all DO's, but I thought if I'm pushed a little to understand some of these solutions I will work out the rest.

For SHG - thanks for that - I'll review it.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,920
Messages
6,122,264
Members
449,075
Latest member
staticfluids

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top