Lookup based on multiple criteria and date Range

hpatel7

New Member
Joined
Oct 25, 2021
Messages
1
Office Version
  1. 365
Platform
  1. Windows
  2. Mobile
  3. Web
Hello All,

I'm trying to do a lookup wherein "Log" pulls the appropriate hours from column C of "TimeSheet" based on the name and the date. I'd like for the hours to populate the appropriate month in columns J-U in "Log" based on the number they entered in the TimeSheet. Expected results are populated in columns J-U. The tricky part is that there are 2 people who are in there twice under different work orders under different start/end dates.

Any advice here would be helpful!

Thank you!

Log
IT Retainer Request_sample2.xlsx
ABCDEFGHIJKLMNOPQRSTU
1#Date SubmittedRoleStart DateEnd DateEstimated Hours per Month (per resource)Work Order NumberResource NameBudgeted Bill RateJul-21Aug-21Sep-21Oct-21Nov-21Dec-21Jan-22Feb-22Mar-22Apr-22May-22Jun-22
21610/18/2021 2:25 PMPMO Advisor9/7/20213/31/2022403Laura$162.00000000000000
31510/18/2021 2:25 PMProject Support9/7/20213/31/2022403Larry$135.000039.5000000000
41310/18/2021 1:36 PMOptime ID/PT7/26/20211/28/20221732Lekan$121.5040160200000000000
51210/18/2021 1:28 PMProject Support7/12/20218/27/2021151Laura$135.0002037.25000000000
61110/18/2021 1:28 PMPMO Advisor7/12/20218/27/2021401Larry$162.0018.540.250000000000
Log


TimeSheet
IT Retainer Request_sample2.xlsx
ABC
1DateEmployeeHours
27/12/2021Larry1
37/14/2021Larry2
47/16/2021Larry2
57/19/2021Larry2.5
67/20/2021Larry1
77/21/2021Larry1
87/22/2021Larry1.5
97/23/2021Larry2
107/26/2021Larry1.5
117/26/2021Lekan10
127/27/2021Larry4
137/27/2021Lekan10
147/28/2021Lekan10
157/29/2021Lekan10
168/1/2021Larry3
178/2/2021Larry4
188/2/2021Lekan10
198/2/2021Laura1.75
208/3/2021Larry2.5
218/3/2021Lekan10
228/3/2021Laura3.75
238/4/2021Larry5.5
248/4/2021Lekan10
258/4/2021Laura2
268/5/2021Larry4.5
278/5/2021Lekan10
288/5/2021Laura4.5
298/6/2021Larry2
308/6/2021Laura1
318/8/2021Larry0.5
328/9/2021Larry1.5
338/9/2021Lekan10
348/9/2021Laura1
358/10/2021Lekan10
368/11/2021Larry2.5
378/11/2021Lekan10
388/11/2021Laura0.5
398/12/2021Larry1
408/12/2021Lekan10
418/13/2021Larry0.5
428/15/2021Larry1.25
438/16/2021Larry0.5
448/16/2021Lekan10
458/17/2021Larry3
468/17/2021Lekan10
478/17/2021Laura2.75
488/18/2021Larry1
498/18/2021Lekan10
508/18/2021Laura2
518/19/2021Larry1.5
528/19/2021Lekan10
538/19/2021Laura0.5
548/23/2021Larry0.5
558/23/2021Lekan10
568/24/2021Lekan10
578/25/2021Larry1.5
588/25/2021Lekan10
598/25/2021Laura0.25
608/26/2021Larry2
618/26/2021Lekan10
628/27/2021Larry0.5
638/30/2021Larry1
649/1/2021Larry0.5
659/1/2021Lekan10
669/2/2021Lekan10
679/3/2021Lekan10
689/4/2021Lekan10
699/7/2021Lekan10
709/8/2021Larry0.5
719/8/2021Lekan10
729/9/2021Larry3
739/9/2021Lekan10
749/9/2021Laura2.5
759/10/2021Larry2.5
769/10/2021Lekan10
779/10/2021Laura1.5
789/13/2021Larry2
799/13/2021Lekan10
809/13/2021Laura1
819/14/2021Larry5
829/14/2021Lekan10
839/14/2021Laura4
849/15/2021Larry5
859/15/2021Lekan10
869/15/2021Laura4.25
879/16/2021Lekan10
889/17/2021Larry3
899/18/2021Larry0.5
909/20/2021Larry3
919/20/2021Lekan10
929/20/2021Laura1.75
939/21/2021Larry1
949/21/2021Lekan10
959/21/2021Laura1.5
969/22/2021Larry1
979/22/2021Lekan10
989/22/2021Laura3
999/23/2021Larry4
1009/23/2021Lekan10
1019/23/2021Laura4
1029/24/2021Larry1
1039/24/2021Laura0.5
1049/27/2021Lekan10
1059/27/2021Laura2.5
1069/28/2021Larry2.5
1079/28/2021Lekan10
1089/28/2021Laura5.75
1099/29/2021Larry4
1109/29/2021Lekan10
1119/29/2021Laura3
1129/30/2021Larry1
1139/30/2021Lekan10
1149/30/2021Laura2
TimeSheet
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
Hi & welcome to MrExcel.
How about
Excel Formula:
=IF(AND(J$1<$E2,EOMONTH(J$1,0)>$D2),SUMIFS(TimeSheet!$C:$C,TimeSheet!$B:$B,$H2,TimeSheet!$A:$A,">="&J$1,TimeSheet!$A:$A,"<="&EOMONTH(J$1,0)),0)
 
Upvote 0
Hi HPatel7,

SUMIFS will do this but you may want to do a cross-check.
e.g. the total hours on TimeSheet are 555.5 but the total hours reported on Log are 554. The discrepancy is Larry with 1 hour on 30 August 2021 and 0.5 hours on 1 September 2021, but the two date ranges for Larry (07-Sep-21 to 31-Mar-22, 12-Jul-21 to 27-Aug-21) do not include those dates.

Please also note that as Timesheet does not include a Work Order Number then if the same name has multiple overlapping Start/End Dates then hours in the overlap period will be double counted.


HPatel7.xlsx
ABCDEFGHIJKLMNOPQRSTU
1#Date SubmittedRoleStart DateEnd DateEstimated Hours per Month (per resource)Work Order NumberResource NameBudgeted Bill RateJul-21Aug-21Sep-21Oct-21Nov-21Dec-21Jan-22Feb-22Mar-22Apr-22May-22Jun-22
21644487.6PMO Advisor07-Sep-2131-Mar-22403Laura1620037.25000000000
31544487.6Project Support07-Sep-2131-Mar-22403Larry1350039000000000
41344487.57Optime ID/PT26-Jul-2128-Jan-221732Lekan121.540160200000000000
51244487.56Project Support12-Jul-2127-Aug-21151Laura1350200000000000
61144487.56PMO Advisor12-Jul-2127-Aug-21401Larry16218.539.250000000000
Log
Cell Formulas
RangeFormula
K1:U1K1=EOMONTH(J1,0)+1
J2:U6J2=SUMIFS(TimeSheet!$C:$C,TimeSheet!$B:$B,$H2,TimeSheet!$A:$A,">="&J$1,TimeSheet!$A:$A,"<="&EOMONTH(J$1,0),TimeSheet!$A:$A,">="&$D2,TimeSheet!$A:$A,"<="&$E2)
Named Ranges
NameRefers ToCells
TimeSheet!_FilterDatabase=TimeSheet!$A$1:$F$114J2:U6
 
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,240
Members
452,621
Latest member
Laura_PinksBTHFT

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top