Two-Way look up with criteria between two dates

herica

New Member
Joined
Feb 19, 2018
Messages
2
Below is a mock example of my spreadsheet.

Column B has the names of Tutors who deliver training hours to the Students listed in Column A. And Colums C1:I1 have all the dates for every month (showing is just 23Jan-31Jan).

SS#1
[TABLE="class: outer_border, width: 1352"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[TD]F[/TD]
[TD]G[/TD]
[TD]H[/TD]
[TD]I[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Student[/TD]
[TD]Tutor[/TD]
[TD]23-Jan[/TD]
[TD]24-Jan[/TD]
[TD]25-Jan[/TD]
[TD]26-Jan[/TD]
[TD]29-Jan[/TD]
[TD]30-Jan[/TD]
[TD]31-Jan[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]Josh[/TD]
[TD]Bob T[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]2:00[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]Nicole[/TD]
[TD]Bob T[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]2:00[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]Caitie[/TD]
[TD]Amanda M[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]1:30[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]Hannah[/TD]
[TD]Raymond F[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]Devon[/TD]
[TD]Lexi A[/TD]
[TD="align: right"]2:00[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]2:00[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]

I need a formula to give me the underlined answers in the below sample SS (e.g. I need to add up all training hours for each Tutor between 2 dates, and I need these two dates to be able to be changed).

SS#2
[TABLE="class: outer_border, width: 100"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Period to be summed[/TD]
[TD]29-Jan[/TD]
[TD]31-Jan[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]Tutor[/TD]
[TD]Total Delivered[/TD]
[TD]During this period[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]Amanda M[/TD]
[TD]1:30
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]Bob T[/TD]
[TD]4:00[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]Lexi A[/TD]
[TD]0:00
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]Raymond F[/TD]
[TD]2:00[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]

The 2 most promising formulas I have are these:


=SUMIFS('SS#1'!C1:I1,'SS#1'!B:B,B2,'SS#1'!C1:I1,">="&'SS#2'!B1,'SS#2'!C1:I1,"<="&C1
which gives me a #VALUE error

And:


=SUMPRODUCT(--('SS#1'!C1:I1>='SS#2'!B1)*('SS#1'!C1:I1<='SS#2'!C1)*('SS#1'!B:B=B2))

This 'works' however gives me a value of 0 so something isn't working there... Does anyone have any ideas? :(
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
Maybe something like this:
Excel Workbook
ABCDEFGHIJ
11. 1StudentTutor23-Jan24-Jan25-Jan26-Jan29-Jan30-Jan31-Jan
22JoshBob T2:00
33NicoleBob T2:00
44CaitieAmanda M1:30
55HannahRaymond F
66DevonLexi A2:002:00
7SS#2
8
9ABC
101Period to be summed29-Jan31-Jan
112TutorTotal DeliveredDuring this period
123Amanda M1:30
134Bob T4:00
145Lexi A2:00
156Raymond F0:00
Sheet
 
Upvote 0
Thank you so much! Glad it was actually something 'simple'. Annoying it doesn't work across different spreadsheets/worksheets but hey, at least there's a version that works!
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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