I am not looking for a VBA solution to this. The goal is to find how many hours John has worked in a 12 month period, starting on 7/1/2015. I have two worksheets. Worksheet one looks like the following:
Name | Date Start | Total Hours
John | 7/1/2015 | Formula goes here
Worksheet two
Date | John | Jane | Joe
7/1/2015 | 3 | 2 | 2.5
7/2/2015 | 3 | 2.5 | 0
rest of attendance data
The dates can go down as far as the spreadsheet will allow. What I'm looking to do is to keep the function in the worksheet formula. The formula I have now is:
=SUMIFS(Worksheet2!B:B, Worksheet2!$A:$A, ">="&Worksheet1!$B2, Worksheet2!$A:$A, "<="&EDATE(Worksheet1!$B2, 12))
If I did this through VBA, I could do something like:
Range("B"&2 & ":" & "B" & 1058476)
But I am looking for some way to look up what column the person, whos name is on sheet 1 in the row, what column their name occurs in sheet 2; then, sum up all the values in that column in sheet 2 that fall between the the 12 month time span, and put that number in worksheet 1 cell C2. I don't want to use Worksheet2!B:B.