The numbers in your sample file are a little curious... I'm guessing these are wrong ? (ie WIP)
My suggestion would be thus:
The above will ensure the starting month is the first date used in your data set.
Further to the above - to aid latter calcs - I'd store the end date of each month in the row above, eg:
With the above in place we can then populate the Matrix based on start date, end date & weekday allocation, eg:
Using your sample data this would generate a total of 1212 days
(10 in Oct-10, 247 in Nov-10, 253 in Dec-10, 258 in Jan-11, 232 in Feb-11, 212 in Mar-11)
Given use of 2003 in all of the above I've avoided use of ATP functions like EDATE, EOMONTH etc and have used DATE based functions instead.
I hope that helps
P.S. I'm pretty sure Daddylonglegs could condense the above - it's not overly efficient given use of SUMPRODUCT - however given the ranges used are small (max 31 days) I hope it won't prove too slow.