Edit I've had some time to rethink this one. Please see my post that follows this one.
OK I think it's finished.
LOL!
In the AMAs sheet there is a set of lookup tables. They extract and filter relevant columns from each of the sheets. They are all variations on a base formula I retained "AMA" as an error check in the formula even though all of the DOD dates were AMA. I didn't know if your real life data followed that pattern. I also included an AMA lookup table as a cross check as I was building the formulas. Those can be deleted without affecting the formulas.
In J5 and filled across to L5 this for the monthly counts including the look-backs.In J6 and filled across to L6 for the average days by month including the look-backs.
The file is attached.
Edit BTW: You mentioned size concerns above. These lookup tables include liberal use of the INDIRECT function. INDIRECT is volatile. This means that whenever you edit your workbook.....whether it directly affects the lookup tables or not.......INDIRECT is going to recalculate and each formula dependent....directly or indirectly.......upon those lookups is going to recalculate, too. If this becomes problematic (slow workbook) you may have to resort to directly referencing each monthly sheet in the lookup table or directly referencing each monthly sheet in the final formulas.........Ugh!
and a real pain to edit!
Bookmarks