**Summary**

- Create a base case distribution that works for all your rules

- Make random "trades" between the projects that cannot violate the rules

**Detailed Explanation**

- Work out the expected number of hours to be worked on each project by multiplying the total number of hours by the percentage.

- Fill your 'table' in a completely systematic manner that respects your rules

- Randomly select a pair projects

- Randomly select 2 days

- Trade your minimum time unit (0.1 hours) between them

- Loop !!

**Example Base Cases**

1) Just assign 1/10 of each project to each day

2) Start from the first day and the first project and work left to right, top to bottom (i.e. sequential work)

**Example Trade**

0.1 hours has been moved from project 1 to project 4 on the first Monday, and in response 0.1 hours has been moved the opposite direction the following Tuesday.

*I considered trading random amounts but I think this might skew towards extremes e.g. 0 or 8 hours allocated more often than middle values. Plus it's easier to always trade the minimum unit and just run the loop a huge number of times.*

**Filtering Out Invalid Trades**

*If the you cannot find a day (because one project only has work to send where the other is already maxed then just discard the result and continue with the loop*

*If you happen to select the same day as both donor and receiver day then it actually doesn't matter (the trade will work although in practice results in no change)*

**Pseudo Code**

... tbd ...

**Aside**

I love trying to solve problems using raw Excel and sneaky formulas. I first tried using Excel formulas only but I think this problem may be impossible to solve reliably that way but it was fun to try.