Highest value sum and lowest price sum

mantas84

New Member
Joined
Feb 7, 2014
Messages
2
I must choose one product from each category (A,C,E) and their price sum can't get over Z. Example

[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[TD]F[/TD]
[TD]G[/TD]
[TD]H[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]value1[/TD]
[TD]price1[/TD]
[TD]value2[/TD]
[TD]price2[/TD]
[TD]value3[/TD]
[TD]price3[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]12[/TD]
[TD][TABLE="width: 64"]
<tbody>[TR="class: grid"]
[TD="width: 64, align: right"]168,841[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]9[/TD]
[TD][TABLE="width: 67"]
<tbody>[TR="class: grid"]
[TD="width: 67, align: right"]127,648[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]8[/TD]
[TD][TABLE="width: 64"]
<tbody>[TR="class: grid"]
[TD="width: 64, align: right"]107,839[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]14[/TD]
[TD][TABLE="width: 64"]
<tbody>[TR="class: grid"]
[TD="width: 64, align: right"]197,833[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]11[/TD]
[TD][TABLE="width: 67"]
<tbody>[TR="class: grid"]
[TD="width: 67, align: right"]149,013[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]9[/TD]
[TD][TABLE="width: 64"]
<tbody>[TR="class: grid"]
[TD="width: 64, align: right"]125,644[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]16[/TD]
[TD][TABLE="width: 64"]
<tbody>[TR="class: grid"]
[TD="width: 64, align: right"]232,356[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]12[/TD]
[TD][TABLE="width: 67"]
<tbody>[TR="class: grid"]
[TD="width: 67, align: right"]174,298[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD]10[/TD]
[TD][TABLE="width: 64"]
<tbody>[TR="class: grid"]
[TD="width: 64, align: right"]146,645[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]Sum Value[/TD]
[TD]Spended[/TD]
[TD]Can spend[/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]Which one?[/TD]
[TD][/TD]
[TD]Which one?[/TD]
[TD][/TD]
[TD]Which one?[/TD]
[TD][/TD]
[TD]X[/TD]
[TD]Y[/TD]
[TD]Z[/TD]
[/TR]
</tbody>[/TABLE]
So the X must be as highest as possible and Y<=Z.
How can I find a best combination of (A,C,E)?
 
Hi, what would be the answer for the data you posted?
X= 16?
Z equals 9 or 10?
Y equals 9?
 
Upvote 0
it depends from inputed Z.
For example if Z is 560,000 then X= 38 (A4+C4+E4=16+12+10), Y=553,299 (B4+D4+F4=232,356+174,298+146,645) and A6=3, C6=3, E6=3.
If Z=500,000, then X=35 (A3+C3+A4), Y=493,491 (B3+D3+F4), A6=2, C6=2, E6=3.
 
Upvote 0

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