Hello,
I am trying to create a list of permutations which select from an inventory of items, sometimes multiple or none based on an available quantity, and then check a reference value of those items to see if they meet a particular total. For instance, such a set:
(I apologize for the formatting of both of these tables. Whitespace I use while editing this post is being removed by the forum after submission.)
Item Quantity Value
Part A 0-2 100
Part B 0-4 70
Part C 0-4 40
Part D 0-6 10
By doing this manually I can create a permutation list that appears as this:
A B C D Total Pieces
1 0 2 3 4 300 9
2 0 2 4 0 300 6
3 0 3 1 5 300 9
4 0 3 2 1 300 6
5 0 4 0 2 300 6
6 1 0 4 4 300 9
7 1 1 2 5 300 9
8 1 1 3 1 300 6
9 1 2 0 6 300 9
10 1 2 1 2 300 6
11 2 0 1 6 300 9
12 2 0 2 2 300 6
13 2 1 0 3 300 6
I've done this manually using an inventory set up to approximately 80,000 rows, however now I have a larger inventory data set which results in approximately 1.4 billion rows, exceeding the limits of excel using my previous methods. I'm afraid I will have to purchase a C++ compiler to create a program which tests each permutation for the desired total value and then dumps entries to a text file, however I believe it is likely this can be done in Excel using methods I am not skilled enough to apply.
For example, I have attached the sample file I used to create this list. Sheet 1 is the raw data including every possible permutation. Sheet 2 contains the same data but sorted, with point per item subtotals hidden for formatting, and with a piece total. Sheet 3 is my desired final result, cut to show only those permutations which match the desired value total.
Thank you very much for taking the time to read my post! I hope you find this problem as intriguing as I do!![]()
Bookmarks