Datediff with a difference (Not sure its possible)

askewrj

New Member
Joined
Dec 2, 2010
Messages
5
I would like to calculate the time diffrence between 2 dates in DD/MM/YYYY HH:MM format which is easy enough. Howver I need to apply this agains a service delivery model:

e.g. date 1 is 01/12/2010 09:00 and date 2 is 02/12/2010 09:00 so the diffrence is 24:00 hrs What I need to take into account is that between 7PM and 7AM our helpdesk is closed so I do not want to count those hours, so the formula should resolve 12 hours not 24. Also I need the same functionality for 2 dates spanning a weekend.

Not sure if its possible? Any help would be appriciated.

Cheers
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
If you have start time/date in A2 and end time date in B2 then you can use this formula in C2

=(NETWORKDAYS(A2,B2)-1)*("17:00"-"7:00")+MOD(B2,1)-MOD(A2,1)

assuming that the times are always within working hours.

custom format C2 as [h]:mm
 
Upvote 0
Barry, your an excel genius, thats certainly helpdes out for the calls that span those hours. Any ideas how I would go about doing the same for ommitting weekends. I assuem thats way more complex as you have to determine what day of the week the dates are etc.

If not no worried thats saved a huge chunk of my time. Cheers Rob
 
Upvote 0
The formula I suggested already omits the weekends (NETWORKDAYS counts only Monday-Friday days between two dates). If you want you can also include a holiday range in NETWORKDAYS so you can also exclude holidays that you define
 
Upvote 0
Dear Mr. Houdini:
Is it possible to get the network days function to shift where the weekend is? for example living in a country that has thursday friday as the weekend and not saturday sunday? is that possible? thanks.
 
Upvote 0
Yes, you can "offset" the days so if Thu/Fri is the weekend you can use

=NETWORKDAYS(A2+2,B2+2)

....or if you have Excel 2010 you can use NETWORKDAYS.INTL function which lets you customise the weekend days
 
Upvote 0

Forum statistics

Threads
1,214,599
Messages
6,120,449
Members
448,966
Latest member
DannyC96

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