Permutations With Repetition and other constraints

ryan4osu

Board Regular
Joined
Dec 31, 2007
Messages
155
I have a project I’ve been working on for work. I’ve been searching the internet for a similar solution for a few weeks and haven’t been able to find a close enough solution that I can modify.

I’m trying to maximize the useable product off of a manufacturing machine that is 280” (inches) wide. We sell the product in different widths. So I am ultimately trying to create a tool that will allow me to input the different widths that I need and then find the permutations that fall between 275 & 280". From there, I’ll find the best permutations from the generated list that I can use to manufacture all of the needed product.

When I’ve looked at different examples, it appears that I’m looking for permutations with repetition.

The other requirements that I need are:
• With repetition – so that one size could be used multiple times in the solution
• Need the Permutations to be between 4 and 9 widths at a time. Meaning I could use 70” 4 times to get 280”, 31” 9 times to get 279” or any other combination of widths to get between 275 & 280”
• I need to be able to input between 15-25 widths for the macro to be able to process
• Any permutation that doesn’t fall between 275 & 280” should be discarded or not included in the final list
• Generate a list of valid permutations in a 9 column table with the sum of the widths in the 10th column

The closest example I could find to this was located at Generate all possible permutations given input values

I don’t know how to modify it to meet my needs.

Any help would be greatly appreciated.
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.

Forum statistics

Threads
1,214,376
Messages
6,119,179
Members
448,871
Latest member
hengshankouniuniu

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