Forum

Notifications
Clear all

OT Calculation: Calculate hours shared by two intervals

3 Posts
2 Users
0 Reactions
81 Views
(@dmurray3)
Posts: 4
Active Member
Topic starter
 

Hi all,

I am have trouble calculating the number of hours shared by two intervals, specifically when the 'period of interest' crosses the day boundry.

The main formula I have been working with is: 

IF(start<end; MIN(end; upper)-MAX(start; lower); MAX(0;upper-start)+MAX(0;end-lower))

where: WorkShift begins = start; Workshift finishes = end; Period of Interest Begins: lower; Period of Interest Finishes: upper 

The above formula DOES consider when the Workshift cross the day boundry, but fails when both Workshift and Period of Interest.

An important issue is that, I am not using dates+times, but rather only 'times', and would prefer to keep working that way, even though it may prove to be tougher...

Enclosed my sample case which expands the definitions and details I am working with, and trust that you can provide guidance as to how to solve my problem.

Many thanks in advance for your time and feedback. 

Kind regards, DMurray3

 
Posted : 15/08/2017 10:31 pm
(@sunnykow)
Posts: 1417
Noble Member
 

Hi Daniel

The formula is quite long but you can give it a try.

I have modified your formula in column H as I need to get the fraction portion of the time else the formula will not work.

Hope this helps.

Sunny

 
Posted : 17/08/2017 2:49 am
(@dmurray3)
Posts: 4
Active Member
Topic starter
 

Many ThanksSunnyKow...

I will run your recommended formulae against some real data, just to confirm it doesn't break down the line.

Will revert any findings.

In appreciation,

Daniel Murray

 
Posted : 19/08/2017 12:14 am
Share: