Calculating overlapping times between two tables

nate1

New Member
Joined
Apr 2, 2007
Messages
44
Office Version
  1. 365
Platform
  1. Windows
Hello,
I am trying to find a way to determine how much overlapping time each person in Proj1 has with people in Proj2. I have a table entry in Proj1 that lets me know how many overlaps in time there are, and I can individually tally up the amount of overlap for each person using the Median functionality, but I cant seem to figure out how to make all that happen in one neat and tidy formula. I would like the formula in F3:F12 (Proj1[Overlap time]) to run that median formula for each of the entries in Proj2, and sum them. It should give me the results that I have shown in J3:J9. I am not sure why blank cells are returning strange results highlighted in orange... and one more complicating factor is that it is possible for these times to span across two days, im not sure how this will react if a shift runs past midnight.
Please help, any help is greatly appreciated.
Book3.xlsx
ABCDEFGHIJ
1Proj1overlap w/ Fredoverlap w/ Georgetotal
2StartEndNametime#OverlapsOverlap time
36:007:20Billy1:2000:440:000:000:00
47:208:35Bob1:1510:440:210:000:21
58:359:48Sally1:1320:361:080:051:13
69:4810:15Rachel0:2710:080:000:120:12
710:1511:37Joe1:2200:080:000:000:00
811:3712:49Mary1:1200:080:000:000:00
912:4913:00Ralf0:1100:080:000:000:00
1013:00CLSD 00:170:440:080:53
11  0:531:290:171:46
12  0:531:290:171:46
13
14
15Proj2
16StartEndNametime
178:149:43Fred1:29
189:4310:00George0:17
19 
20 
21 
22 
23 
24 
25 
26 
Sheet1
Cell Formulas
RangeFormula
D3:D12,D17:D26D3=IF([@End]="","",[@End]-[@Start])
E3:E12E3=IF([@Start]="","",SUMPRODUCT(([@Start]<=Proj2[End])*([@End]>=Proj2[Start])))
F3:F12F3=SUM(MEDIAN([@Start],[@End],Proj2[End])-MEDIAN([@Start],[@End],Proj2[Start]))
H3:H12H3=MEDIAN(Proj1[@Start],Proj1[@End],$B$17)-MEDIAN(Proj1[@Start],Proj1[@End],$A$17)
I3:I12I3=MEDIAN(Proj1[@Start],Proj1[@End],$B$18)-MEDIAN(Proj1[@Start],Proj1[@End],$A$18)
J3:J12J3=SUM(H3:I3)
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
I really didnt think this would be such a tough nut to crack...
 
Upvote 0

Forum statistics

Threads
1,223,234
Messages
6,170,891
Members
452,366
Latest member
TePunaBloke

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