This struck me as an interesting challenge....
First, I would make a fairly fundamental point... given the complexity of the model and the calculations you should really be looking to avoid Volatility as the performance impact will be significant.
For ex. on 7.6 sheet you are (understandably) using:
in cell B16... however this means that every other cell/calculation that utilises this value (via today range) is also Volatile thereby increasing the Calculation overhead in your model.
To avoid this I would suggest you use the VBA workbook open event to update this date value with a static value thereby removing all of this Volatility, eg:
(above would reside in ThisWorkbook).
The next point I would make concerns your named ranges - which are presently inconsistent in terms of:
a) their scope (workbook / worksheet)
b) their dimensions (column references)
For the purposes of this exercise alone I would probably advise the following names:
You can then in theory use a UDF to do what you want - which given the Volatility is now removed should not perform too badly
The above would be called from a cell along the lines of:
If you wanted to you could modify the above to return both count and the names included in the count
The above calculation is returning the count of unique names that are active on any given day - not the count of names.
It is assumed that if the project start date prececeds the date criteria and that the "left" value is something other than "Closed" then the project can be deemed to be active.
I hope that helps - and I'm sure it can be improved upon.
To reiterate though - if you implement the above without first removing the volatility your file will perform very badly in Auto Calc mode.
Bookmarks