Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default Subtracting Dates - Mike

Hi,

I'm trying to figure out the elapsed time (or the turnaround time) between
two dates at work. I have input it as such:

Date Received: 5/4/07 3:41 PM
Date Due By: 5/8/07 1:40 PM

Using this formula: =(DAY(G5)-DAY(F5))&" days and "&TEXT(G5-F5,"h:mm")

For that specific time frame, the formula works perfectly. I have this for
an answer: 4 days and 21:59

However, when these two dates come up, I have a problem.

Date Received: 4/30/07 4:26 PM
Date Due By: 5/3/07 1:00 PM

For that date range, I bring this back for an answer: -27 days and 20:34

I know, in theory, why it is pulling back that answer, but does anybody know
what adjustments I could make to the formula to bring me back the answer I'm
looking for? Thanks a lot.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4,624
Default Subtracting Dates - Mike

One way:

=INT(G5-F5) & " days and " & TEXT(MOD(G5-F5,1), "h:mm")


XL stores date/times as offsets from a base date, with days as integers
and times as fractions.


In article ,
SJUCatch27 wrote:

Hi,

I'm trying to figure out the elapsed time (or the turnaround time) between
two dates at work. I have input it as such:

Date Received: 5/4/07 3:41 PM
Date Due By: 5/8/07 1:40 PM

Using this formula: =(DAY(G5)-DAY(F5))&" days and "&TEXT(G5-F5,"h:mm")

For that specific time frame, the formula works perfectly. I have this for
an answer: 4 days and 21:59

However, when these two dates come up, I have a problem.

Date Received: 4/30/07 4:26 PM
Date Due By: 5/3/07 1:00 PM

For that date range, I bring this back for an answer: -27 days and 20:34

I know, in theory, why it is pulling back that answer, but does anybody know
what adjustments I could make to the formula to bring me back the answer I'm
looking for? Thanks a lot.

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default Subtracting Dates - Mike

=DATEDIF(F5,G5,"y")&" years, "&DATEDIF(F5,G5,"ym")&" months,
"&DATEDIF(F5,G5,"md")&" days "&TEXT(MOD(G5-F5,1),"hh "" hours "" mm"" minutes
"" ss ""seconds""")

will return:

0 years, 0 months, 3 days 20 hours 34 minutes 00 seconds

--
Gary''s Student - gsnu200729


"SJUCatch27" wrote:

Hi,

I'm trying to figure out the elapsed time (or the turnaround time) between
two dates at work. I have input it as such:

Date Received: 5/4/07 3:41 PM
Date Due By: 5/8/07 1:40 PM

Using this formula: =(DAY(G5)-DAY(F5))&" days and "&TEXT(G5-F5,"h:mm")

For that specific time frame, the formula works perfectly. I have this for
an answer: 4 days and 21:59

However, when these two dates come up, I have a problem.

Date Received: 4/30/07 4:26 PM
Date Due By: 5/3/07 1:00 PM

For that date range, I bring this back for an answer: -27 days and 20:34

I know, in theory, why it is pulling back that answer, but does anybody know
what adjustments I could make to the formula to bring me back the answer I'm
looking for? Thanks a lot.

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4,624
Default Subtracting Dates - Mike

Yes, but try it with

F5: 01/31/2007 15:20
G5: 03/01/2007 14:10

0 years, 1 months, -2 days 22 hours 50 minutes 00 seconds

Probably not what the OP wanted...

Better just to do the math.


In article ,
Gary''s Student wrote:

=DATEDIF(F5,G5,"y")&" years, "&DATEDIF(F5,G5,"ym")&" months,
"&DATEDIF(F5,G5,"md")&" days "&TEXT(MOD(G5-F5,1),"hh "" hours "" mm"" minutes
"" ss ""seconds""")

will return:

0 years, 0 months, 3 days 20 hours 34 minutes 00 seconds

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default Subtracting Dates - Mike

Thank you for your first post. It seems to be working the way I wanted it to.

-Mike

"JE McGimpsey" wrote:

Yes, but try it with

F5: 01/31/2007 15:20
G5: 03/01/2007 14:10

0 years, 1 months, -2 days 22 hours 50 minutes 00 seconds

Probably not what the OP wanted...

Better just to do the math.


In article ,
Gary''s Student wrote:

=DATEDIF(F5,G5,"y")&" years, "&DATEDIF(F5,G5,"ym")&" months,
"&DATEDIF(F5,G5,"md")&" days "&TEXT(MOD(G5-F5,1),"hh "" hours "" mm"" minutes
"" ss ""seconds""")

will return:

0 years, 0 months, 3 days 20 hours 34 minutes 00 seconds


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Subtracting Dates jaxstraww Excel Discussion (Misc queries) 0 March 28th 07 01:58 AM
Subtracting Dates jaxstraww Excel Discussion (Misc queries) 0 March 28th 07 01:56 AM
Subtracting dates? Bill R Excel Worksheet Functions 1 August 15th 05 05:37 AM
Subtracting dates: 8/31/05-8/1/05? dstock Excel Discussion (Misc queries) 1 July 26th 05 04:04 PM
subtracting dates to get a age Lori Excel Discussion (Misc queries) 1 February 4th 05 03:49 PM


All times are GMT +1. The time now is 12:54 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"