Duration Formula

kizzie37

Well-known Member
Joined
Oct 23, 2007
Messages
585
Office Version
  1. 365
I have the below Date & time in cell a1 and another date and time in cell a3

8/2/2010 08:45:00
8/2/2010 10:15:00


I need to be able to show duration (in hours) between the 2 times, in this instance its the same date, but this wont always be the case. To add a level of complexity in addition to the gross duration in hours, I will also need to know how long (in hours or mins) of the duration fits into "in hours" ( 9 -5 mon- fri) then the duration thats fits "out of hours" (after 5pm weekdays or all day Sat & Sun)

Appreciate this wont be all in one formula but can anyone suggest how to work through this Please
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
You can use this formula to get the business hours, assuming A2 contains start time/date and B2 end time/date, where both will be in business hours

=(NETWORKDAYS(A2,B2)-1)*("17:00"-"9:00")+MOD(B2,1)-MOD(A2,1)
 
Upvote 0
Thanks to all for this, I have another query though on variance of duration.


Cell b1 = Target Time ( this will be a number of hours, in this case 3)
Cell C1 = Duration (uses one of the formulas above, again a number of hours)


Problem is if the duration is over the target time, the value is displayed as ########

How can I display the minus variance, i need to report how much time duration over target.

Any ideas
 
Upvote 0

Forum statistics

Threads
1,223,275
Messages
6,171,121
Members
452,381
Latest member
Nova88

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