On the results page, Cell A3 will be the Employee Number, Cell B3 will be the From Date, Cell C3 will be the To Date. I need to find a for cell D3, the sum. For example, if A3 had 123456, B3 had 1/2/09, C3 had 1/3/09, then D3 would need to have 17.48 (8.88+8.6)

The way I'm currently looking at is adding a row between C and D on the data table below which contains the row number, then doing a VLOOKUP and a few indexes to pull the data but I'm concerned that pulling data from 7 different tables (for different types of employee hours) for 250 employees would make this take forever to recalculate.

Note that the table below has 12 rows for the 12 months of the years and the columns go all the way to 31. It can be counted on that if a date doesn't exist (for example, 2/30/09, the value in the cell will be 0 which means we can use ranges through the end of the month if needed)

Hours 20090131.xls | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|

A | B | C | D | E | F | G | H | |||

1 | EmployeeNumber | EmployeeName | Month\Day | 1 | 2 | 3 | 4 | 5 | ||

2 | 123456 | WASHINGTON,GEORGE | 1 | 0 | 8.88 | 8.6 | 0 | 8.98 | ||

3 | 2 | 0 | 8.53 | 8.65 | 8.65 | 8.97 | ||||

4 | 3 | 0 | 0 | 0 | 0 | 0 | ||||

5 | 4 | 0 | 0 | 0 | 0 | 0 | ||||

6 | 5 | 0 | 0 | 0 | 0 | 0 | ||||

7 | 6 | 0 | 0 | 0 | 0 | 0 | ||||

8 | 7 | 0 | 0 | 0 | 0 | 0 | ||||

9 | 8 | 0 | 0 | 0 | 0 | 0 | ||||

10 | 9 | 0 | 0 | 0 | 0 | 0 | ||||

11 | 10 | 0 | 0 | 0 | 0 | 0 | ||||

12 | 11 | 0 | 0 | 0 | 0 | 0 | ||||

13 | 12 | 0 | 0 | 0 | 0 | 0 | ||||

14 | 251833 | LINCOLN,ABE | 1 | 0 | 9.98 | 7.52 | 0 | 9.13 | ||

15 | 2 | 0 | 7.93 | 8.52 | 6.53 | 8.58 | ||||

16 | 3 | 0 | 0 | 0 | 0 | 0 | ||||

17 | 4 | 0 | 0 | 0 | 0 | 0 | ||||

18 | 5 | 0 | 0 | 0 | 0 | 0 | ||||

19 | 6 | 0 | 0 | 0 | 0 | 0 | ||||

20 | 7 | 0 | 0 | 0 | 0 | 0 | ||||

21 | 8 | 0 | 0 | 0 | 0 | 0 | ||||

22 | 9 | 0 | 0 | 0 | 0 | 0 | ||||

23 | 10 | 0 | 0 | 0 | 0 | 0 | ||||

24 | 11 | 0 | 0 | 0 | 0 | 0 | ||||

25 | 12 | 0 | 0 | 0 | 0 | 0 | ||||

RegHoursImport |