A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Worksheet Functions
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Calculating (Date and Time) differences



 
 
Thread Tools Display Modes
  #1  
Old April 27th, 2004, 09:19 AM
Frank Kabel
external usenet poster
 
Posts: n/a
Default Calculating (Date and Time) differences

Hi
try the following formula (A9: starting date/time, A10 end
date/time:

=INT(A10)-INT(A9) -(MOD(A10,1)MOD(A9,1)) & " days " & TEXT
(MOD(A10,1)-MOD(A9,1)+(MOD(A10,1)MOD(A9,1)),"h ""hours""
m ""minutes""")

-----Original Message-----
All,
I am trying to develop a formula to calculate the

difference between
one (date and time) and another (date and time) with the

times being in
military format. I want the result to be displayed in (X

hours: X
minutes: X seconds). The data is, for example, a start

(date and time)
in cell K13 and an end (date and time) in K15. My (date

and time) cells
are inputted like this:

4/24/04 6:12.

My problem with my current formula:

Start Time:
4/24/04 6:12

End Time:
4/27/04 0:17

Result:
"3 Days
18 Hours
5 Minutes"

The apparent issue is this duration is not even 3 full

days.
My current formula is as follows:
=CONCATENATE(ROUND(ROUND(((K15-K13)*1440),)/1440,0)," Days
",TRUNC(MOD(ROUND((K15-K13)*1440,0),1440)/60)," Hours
",ROUND(MOD(ROUND((K15-K13)*1440,0),60),0), " Minutes")

I need it to display a result like:
"2 Days
18 Hours
5 Minutes"

I'm gettin a headache trying to figure it out. Please

help!!!!


---
Message posted from http://www.ExcelForum.com/

.

  #2  
Old April 27th, 2004, 09:21 AM
JE McGimpsey
external usenet poster
 
Posts: n/a
Default Calculating (Date and Time) differences

One way:

=INT(K15-K13+0.000001) & "_Days,_" & MOD(INT((K15-K13)*24+0.000001),24)
& "_Hours,_" & MOD(ROUND((K15-K13)*1440,0),60) & "_Minutes"

I replaced the spaces within quotes with underscores to prevent
unfortunate line wrap.

In article ,
Madcap wrote:

All,
I am trying to develop a formula to calculate the difference between
one (date and time) and another (date and time) with the times being in
military format. I want the result to be displayed in (X hours: X
minutes: X seconds). The data is, for example, a start (date and time)
in cell K13 and an end (date and time) in K15. My (date and time) cells
are inputted like this:

4/24/04 6:12.

My problem with my current formula:

Start Time:
4/24/04 6:12

End Time:
4/27/04 0:17

Result:
"3 Days
18 Hours
5 Minutes"

The apparent issue is this duration is not even 3 full days.
My current formula is as follows:
=CONCATENATE(ROUND(ROUND(((K15-K13)*1440),)/1440,0)," Days
",TRUNC(MOD(ROUND((K15-K13)*1440,0),1440)/60)," Hours
",ROUND(MOD(ROUND((K15-K13)*1440,0),60),0), " Minutes")

I need it to display a result like:
"2 Days
18 Hours
5 Minutes"

I'm gettin a headache trying to figure it out. Please help!!!!

  #3  
Old April 27th, 2004, 11:19 PM
Madcap
external usenet poster
 
Posts: n/a
Default Calculating (Date and Time) differences

Being a bit fresh to constructing formulas, I really appreciate the,
albeit possibly simple for you guys, time and effort you shown. Thank
You.


---
Message posted from http://www.ExcelForum.com/

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 04:41 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.