Calculate overlapping hours between two Start End times

Msadiqrajani

Board Regular
Joined
Jan 17, 2009
Messages
107
Hi,

I have Data with start end Time in 24+ hours format like.
StartTimeEnd Time
00:004:30
8:3015:00
15:0020:00
20:0025:30
27:0032:00
34:0044:00

<tbody>
</tbody>

Similar to above, I have one more time range like
Start Time10:00
End Time40:00

<tbody>
</tbody>

I want to calculate Time ranges, so I will get result like this:

StartTimeEnd TimeOver Lap Time
00:004:300:00
8:3015:005:00
15:0020:005:00
20:0025:305:30
27:0032:005:00
34:0044:006:00

<tbody>
</tbody>
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
Hi,

Could you explain how do you achieved those over lap time

Thanks in advance


Vândalo
 
Upvote 0
I have Data with start end Time in 24+ hours format like.
StartTimeEnd Time
00:004:30
8:3015:00
15:0020:00
20:0025:30
27:0032:00
34:0044:00

<tbody>
</tbody>


Similar to above, I have one more time range like
Start Time10:00
End Time40:00

<tbody>
</tbody>


I want to calculate Time ranges, so I will get result like this:

StartTimeEnd TimeOver Lap Time
00:004:300:00

Time Is not overlapping with Start(10:00) and end(40:00)
So its 0:00
8:3015:005:00

Hours 10:00 to 15:00 are overlapping with Start(10:00) and end(40:00)
so its 5:00
15:0020:005:00

Hours 15:00 to 20:00 are overlapping with Start(10:00) and end(40:00)
so its 5:00
20:0025:305:30

Hours 20:00 to 25:30 are overlapping with Start(10:00) and end(40:00)
so its 5:30
27:0032:005:00

Hours 27:00 to 32:00 are overlapping with Start(10:00) and end(40:00)
so its 5:00
34:0044:006:00

Hours 34:00 to 40:00 are overlapping with Start(10:00) and end(40:00)
so its 6:00

<tbody>
</tbody>

 
Upvote 0
Hi,

Using this formula I got your results.

=IF(N6<$M$3,0,IF(N6>$N$3,N6-M6-(N6-$N$3),IF(M6<$M$3,N6-M6-($M$3-M6),N6-M6)))

M3 -> Your 10:00
N3 -> Your 40:00

N6 and M6 are your varying time values

Vândalo
 
Upvote 0
I tried this formula..But got few strange results
BreakStart

<tbody>
</tbody>
BreakEnd

<tbody>
</tbody>
9:00 AM

<tbody>
</tbody>
9:30 AM

<tbody>
</tbody>
Session

<tbody>
</tbody>
Session Start

<tbody>
</tbody>
Session End

<tbody>
</tbody>
Time Overlap

<tbody>
</tbody>
Formula
S17 :00 Am7:45 AM0:00

Its Correct
=IF(C4<$B$2,0,IF(C4>$C$2,C4-B4-(C4-$C$2),IF(B4<$B$2,C4-B4-($B$2-B4),C4-B4)))

<tbody>
</tbody>
S28:00 Am8:45 AM1:30

Its Strange
=IF(C5<$B$2,0,IF(C5>$C$2,C5-B5-(C5-$C$2),IF(B5<$B$2,C5-B5-($B$2-B5),C5-B5)))

<tbody>
</tbody>
S39:00 AM9:45 AM0:30

Its Correct
=IF(C6<$B$2,0,IF(C6>$C$2,C6-B6-(C6-$C$2),IF(B6<$B$2,C6-B6-($B$2-B6),C6-B6)))

<tbody>
</tbody>
S410:00 AM10:45 AM#####



instead of 0value...Why negativeIts Time negative
=IF(C7<$B$2,0,IF(C7>$C$2,C7-B7-(C7-$C$2),IF(B7<$B$2,C7-B7-($B$2-B7),C7-B7)))

<tbody>
</tbody>
S511:00 AM11:45 AM#####

Same here as above.
=IF(C8<$B$2,0,IF(C8>$C$2,C8-B8-(C8-$C$2),IF(B8<$B$2,C8-B8-($B$2-B8),C8-B8)))

<tbody>
</tbody>

<tbody>
</tbody>
 
Upvote 0

Forum statistics

Threads
1,215,391
Messages
6,124,673
Members
449,179
Latest member
fcarfagna

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