I have 150 slots to fill in with 40 different values in a logical sequence.

The 40 different values need to appear a certain number of times (i.e. some need to appear twice, some need to appear 4 times, some need to appear 7 times) with the total equaling 150.

To be more specific, lets say my 40 values are 1-40. 1 needs to appear 7 times in the sequence, 6 needs to appear 3 times, 32 needs to appear 2 times, etc.

So it's a sequence of 150 slots to be filled in with 40 different values that have a pre-determined number of times they must appear.

I'm not even sure excel has these capabilities, but given this info, does anyone know if I can auto generate the sequence of 150?

I appreciate any help and hopefully I've been clear in my description