Date & Time

rendzina

New Member
Joined
Oct 20, 2002
Messages
9
I am trying to calculate the difference between 2 cells. Both contain date & time (dd,mm,yy hh:mm). One contains a due date (a), and the other actual date of delivery (b).

I currently have it working for just the number of days difference, as long as 'b' is larger than 'a'. If, it is the other way around, it errors. + have not managed to include the time variance + then need to add in 'networkdays' so that weekends etc are excluded.

Any suggestions?
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
have you tried removing the time element out of the cell.

eg

36756.053421 would be 18th Aug 2000 01:16.

If you use =trunc("cell ref") this will give you 36756 (the date)
and if you have another cell that subtracts the "trunc cell" formula result from your original date and time cell, you get the time on its own.

Do this for both original dates and times.

Now you should find it easier to work out exactly how much time there is between the two dates and times.
 
Upvote 0
Try this formula,

A2...2/5/03 3:19 PM

B2...2/25/03 1:25 PM

C2=(B2-A2)-((INT(B2)-INT(A2))-NETWORKDAYS(A2+1,B2))
C2...custom format..d, hh:mm

C2 results 13, 22:06....(13days, 22hrs:06mins)

2rrs
 
Upvote 0
Right thought was sorted, how wrong i was :( any ideas any1? am currently feeling like the blondest of the blondes!!!

Need this broken down, real basic like.

This sum only needs to be run when B is later than A, if B is less then answer needs to default to '0'. Probably best if answer is expressed in hours+ minutes. Also, No longer need it to just be network days, need entire time difference including weekends!

Does this make any sense?[/url]
 
Upvote 0

Forum statistics

Threads
1,221,706
Messages
6,161,406
Members
451,702
Latest member
Kc3475

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