PC Review


Reply
Thread Tools Rate Thread

Calculating (Date and Time) differences

 
 
Madcap
Guest
Posts: n/a
 
      27th Apr 2004
All,
I am trying to develop a formula to calculate the difference betwee
one (date and time) and another (date and time) with the times being i
military format. I want the result to be displayed in (X hours:
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) cell
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

 
Reply With Quote
 
 
 
 
Frank Kabel
Guest
Posts: n/a
 
      27th Apr 2004
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/
>
>.
>

 
Reply With Quote
 
JE McGimpsey
Guest
Posts: n/a
 
      27th Apr 2004
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 <(E-Mail Removed)>,
Madcap <<(E-Mail Removed)>> 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!!!!

 
Reply With Quote
 
Madcap
Guest
Posts: n/a
 
      27th Apr 2004
Being a bit fresh to constructing formulas, I really appreciate the
albeit possibly simple for you guys, time and effort you shown. Than
You

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

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Calculating Date AND Time Differences Lea777 Microsoft Excel Worksheet Functions 11 29th May 2006 05:15 PM
Calculating Time and Date Differences =?Utf-8?B?RGFycmFu?= Microsoft Excel Programming 2 16th Feb 2005 01:43 PM
Re: Help!!! Calculating Differences in Date/Time Columns JE McGimpsey Microsoft Excel Misc 1 29th Feb 2004 11:51 PM
Re: Help!!! Calculating Differences in Date/Time Columns gaftalik Microsoft Excel Misc 0 25th Feb 2004 07:28 PM
calculating max/min date differences =?Utf-8?B?TWVsaXNzYQ==?= Microsoft Access Form Coding 1 23rd Dec 2003 07:43 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:47 AM.