PDA

View Full Version : Please help me with this excel generator



IAMNewbie
03-14-2017, 01:06 PM
https://i.imgur.com/2oCcd03.png

Hi !

As you can see, there are 3 groups of numbers (but they could contain any kind of data as well) with numbers. Each group has a MAXIMUM predefined places for its own number of elements. As you can see, in this example all three groups contains 11 predefined places for their elements. It is not compulsory that all the places to be filled with data. As you can see, in these example group 1 and group 2 have 4 cells and, respectively 2 cells free (highlighted with the yellow background color).
User can fill all the cells of each group, or just first X cells on each groups, or even last one or last two groups left completely blank.

As you can see, above each group there are MIN and MAX cells which must be filled with numbers. These are conditions.

Below all of these there is another cells filled with the number 7 (in this example).

Below all of these there should be generated all possible combinations with 7 elements which meet all conditions above, which (in this case) should be between 0 and maximum 3 elements from group 1, between 2 and maximum 7 from 2nd group (it must contain AT LEAST 2 elements of the 2nd group as the condition specifies AND between 3 and maximum 5 elements of the 3rd group.
! Please note that if any of these group has blank cells, spaces doesn't count into combos, just numbers.
That's all.

Please, help me with this.
I have searched for weeks on how to do it and never found out.
Please help me !

Thank you very, very, very much in advance !

Here is the file:
18647

mdmackillop
03-14-2017, 02:42 PM
Looks to me like 16.8M permutations but that is as far as I can take it. I'm sure there is code out there for listing perms for each group, but how you would combine these groups is beyond me.
For what it's worth, here's my approach.

YasserKhalil
03-14-2017, 10:36 PM
Cross-post at this link
http://www.eileenslounge.com/viewtopic.php?f=27&t=26299&p=203990#p203990

mikerickson
03-15-2017, 07:50 AM
Cross post http://www.ozgrid.com/forum/showthread.php?t=203308