Calculate combinations that leads to max intake in VBA using one column

Will_vanthek

New Member
Joined
Oct 1, 2020
Messages
15
Office Version
  1. 365
Platform
  1. Windows
Dear people,

I have a question, hope you can help me. In enclosed image I have a column with number in them, lets say 10 items.
Further I have a cell with 1 number, this is the max to be loaded: 10.000

image.png

Now, I need to find the combinations that will bring me <=10.000.
This means it can be cargo as: 1+2+5+6 or 1 + 4 +5 Etc.

All outcome, all combinations should lead towards the 10000, on top the combinations that are closest to the 10.000.
I see many tutorials doing this with two list etc, but I want to do this in one column, if this possible.

I prefer VBA code, but if otherwise possible than I hope you can help me.

greets will
 
Dear eric, sorry for my late reply. A bit busy. I want to thank you for all your help.
It helped me very much. Thank you for taking the effort.

I will continue my search :)

greets Will
 
Upvote 0

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.

Forum statistics

Threads
1,214,806
Messages
6,121,672
Members
449,045
Latest member
Marcus05

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