Elapsed Time calculation

itzashish

New Member
Joined
Aug 22, 2017
Messages
3
Hi There,

Any quick fix, please?
I need the total open time of the SRs excluding any overlapping hours. In the below example, the total time is 11:42 hrs. Bt in the actual data dump, there would be even more number of rows for the same SR with no sorting.

SR #Start Date TimeEnd Date Time
TSHJKL43566/1/2017 7:106/1/2017 11:03
TSHJKL43576/1/2017 13:156/1/2017 17:03
TSHJKL43586/1/2017 15:086/1/2017 20:22
TSHJKL43596/1/2017 16:086/1/2017 17:10
TSHJKL43606/1/2017 6:356/1/2017 9:24

<colgroup><col span="3"></colgroup><tbody>
</tbody>


Please help with a formula or code.
 
Here is my take on it. This array formula returns 11:35 for the dataset from Post # 1:

=MAX(C2:C6)-MIN(B2:B6)-SUM(IF(B3:B6-C2:C5>0,B3:B6-C2:C5))
 
Upvote 0

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
Here is my take on it. This array formula returns 11:35 for the dataset from Post # 1:

=MAX(C2:C6)-MIN(B2:B6)-SUM(IF(B3:B6-C2:C5>0,B3:B6-C2:C5))

Yes it works with dataset from post 1, but doesn't seem to work with

A
B
C
1
SR #​
Start Date Time​
End Date Time​
2
TSHJKL4356​
06/01/2017 07:10​
06/01/2017 11:03​
3
TSHJKL4357​
06/01/2017 13:15​
06/01/2017 17:03​
4
TSHJKL4358​
06/01/2017 15:08​
06/01/2017 20:22​
5
TSHJKL4359​
06/01/2017 16:08​
06/01/2017 17:10​
6
TSHJKL4360​
06/01/2017 06:35​
06/01/2017 09:24​
7
TSHJKL4360​
06/01/2017 18:00​
06/01/2017 20:00​

M.
 
Upvote 0
Ah, the column sorting... Let's see if this one works better (also an array formula):

=MAX(C2:C7)-MIN(B2:B7)-SUM(IF(SMALL(B2:B7,ROW(INDIRECT("2:"&COUNT(B2:B7))))-SMALL(C2:C7,ROW(INDIRECT("1:"&COUNT(C2:C7)-1)))>0,SMALL(B2:B7,ROW(INDIRECT("2:"&COUNT(B2:B7))))-SMALL(C2:C7,ROW(INDIRECT("1:"&COUNT(C2:C7)-1)))))
 
Upvote 0

Forum statistics

Threads
1,216,727
Messages
6,132,354
Members
449,720
Latest member
NJOO7

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