Need to calculate difference between date/time fields

hollinan

New Member
Joined
Jun 11, 2008
Messages
28
I am trying to count the difference between two fields which are date/time to show if we met our service level agreements. However, I don't want to count non business hours.

Business Hours are 8-5.

For example

Cell G3 is the date customer wants to close the deal - 6/23/2008 9:00 AM

Cell I3 is actual closing date 6/23/2008 10:45 AM

I would expect to see (1:45)

Can anyone help? Thanks!
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
It's just subtraction. If your time in is in C2 and your time out is in D2, the formula would be =D2-C2
 
Upvote 0
I tried that, but it doesn't give me a negative number. It just shows as #######. Also, this wouldn't account for non business hours would it?
 
Upvote 0
Yeah, it won't do that. You can use a custom number format, or you have to change the date system to 1904 dates.

If your formula would be =ABS(I3-G3) you can then format it as -h:mm or (h:mm) to display the negative value, although you have to be careful and realize that the cell value is actually positive, in subsequent calculations.
 
Upvote 0

Forum statistics

Threads
1,213,501
Messages
6,114,010
Members
448,543
Latest member
MartinLarkin

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