I have a list of dates and times for employee time sheets. The times begin in column F, and end in column G. Sometimes there are overlapping times for projects. The employee does not get paid for overlapping projects, yet we need to track each project separately. I would like to be able to look at columns E, F and G and find any overlapping projects, and return a single time entry. In the example below, notice that line 1 does NOT overlap with the others, but that there is a series of overlapping entries in lines 2-6. They don't necessarily all overlap, but are more like a "chain." I want to write a formula (not a script) to solve this.
+---+------------+------------+----------+
| | E | F | G |
+---+------------+------------+----------+
| 1 | 10/11/2017 | 12:30 PM | 1:00 PM |
| 2 | 10/11/2017 | 1:00 PM | 3:00 PM |
| 3 | 10/11/2017 | 2:15 PM | 6:45 PM |
| 4 | 10/11/2017 | 2:30 PM | 3:00 PM |
| 5 | 10/11/2017 | 2:15 PM | 6:45 PM |
| 6 | 10/11/2017 | 3:00 PM | 6:45 PM |
+---+------------+------------+----------+
I would want to evaluate these columns and return the total duration of each "chain" on the final line of the series of overlaps. In my example below, we'll put that in column H. It finds 5.75 hours for the series that begins in row 2 and ends in row 6 (1 pm to 6:45 pm).
+---+------------+------------+----------+------------+
| | E | F | G | H |
+---+------------+------------+----------+------------+
| 1 | 10/11/2017 | 12:30 PM | 1:00 PM | 0.5 |
| 2 | 10/11/2017 | 1:00 PM | 3:00 PM | overlap |
| 3 | 10/11/2017 | 2:15 PM | 6:45 PM | overlap |
| 4 | 10/11/2017 | 2:30 PM | 3:00 PM | overlap |
| 5 | 10/11/2017 | 2:15 PM | 6:45 PM | overlap |
| 6 | 10/11/2017 | 3:00 PM | 6:45 PM | 5.75 |
+---+------------+------------+----------+------------+
I've tried writing queries, but keep finding myself back at the beginning. If anyone has a suggestion, I'd love to know it! Thank you in advance.
Neill