|I think you could use a Dynamic Range Name to do this. I tried this and it seems to work. |
Dates are in A1:A31
Hours are in B1:B31
The first date you want to match is in C1
The last date you want to match is in D1
Pull down Insert...Name...Define
In the Names In Workbook box enter MyHours
In the Refers to box enter this formula:
=OFFSET($B$1, MATCH($C$1,$A1:$A$31)-1, 0,(MATCH($D$1,$A1:$A$31)-MATCH($C$1,$A1:$A$31)+1))
To use this Dynamic Range Name, enter =SUM(MyHours) in a cell.
By using the formula given, the range MyHours will be determined by the location of the dates in A1:A31 that match the dates in C1 and D1. C1 will determine the row value and D1 will determine the height value.