Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
dtencza
 
Posts: n/a
Default Time calculation (in hh.mm) spanning more than one day

I would like to calculate the difference between two dates and times and have
the result be in hh.mm.

So if in Cell A1 I have '8/15/2005 9:30 AM'
and if in Cell A2 I have '8/16/2005 11:17 AM' then...

I would want the result in Cell A3 to be 26:01.

Can anyone tell me what formula I would use to do this? My boss asked me
just a few minutes ago!


  #2   Report Post  
JE McGimpsey
 
Posts: n/a
Default

One way:

Format/Cells/Number/Custom [h]:mm

In article ,
"dtencza" wrote:

I would like to calculate the difference between two dates and times and have
the result be in hh.mm.

So if in Cell A1 I have '8/15/2005 9:30 AM'
and if in Cell A2 I have '8/16/2005 11:17 AM' then...

I would want the result in Cell A3 to be 26:01.

Can anyone tell me what formula I would use to do this? My boss asked me
just a few minutes ago!

  #3   Report Post  
dtencza
 
Posts: n/a
Default

I realized after I posted this that Cell A2 should say '8/16/2005 11:31 AM'
in my example.

I have the cell formatted the way I want, I just can't get the calculation
correct if the dates span over a day If anyone has made a formula that does
this and can share it, I'd be really grateful.

"JE McGimpsey" wrote:

One way:

Format/Cells/Number/Custom [h]:mm

In article ,
"dtencza" wrote:

I would like to calculate the difference between two dates and times and have
the result be in hh.mm.

So if in Cell A1 I have '8/15/2005 9:30 AM'
and if in Cell A2 I have '8/16/2005 11:17 AM' then...

I would want the result in Cell A3 to be 26:01.

Can anyone tell me what formula I would use to do this? My boss asked me
just a few minutes ago!


  #4   Report Post  
RagDyer
 
Posts: n/a
Default

The formula is simply the larger (later) minus the smaller (earlier):

=A2-A1

And John gave you the custom format to use, so that the results in excess of
24 wouldn't roll over into days.
--
HTH,

RD
==============================================
Please keep all correspondence within the Group, so all may benefit!
==============================================


"dtencza" wrote in message
...
I realized after I posted this that Cell A2 should say '8/16/2005 11:31

AM'
in my example.

I have the cell formatted the way I want, I just can't get the calculation
correct if the dates span over a day If anyone has made a formula that

does
this and can share it, I'd be really grateful.

"JE McGimpsey" wrote:

One way:

Format/Cells/Number/Custom [h]:mm

In article ,
"dtencza" wrote:

I would like to calculate the difference between two dates and times

and have
the result be in hh.mm.

So if in Cell A1 I have '8/15/2005 9:30 AM'
and if in Cell A2 I have '8/16/2005 11:17 AM' then...

I would want the result in Cell A3 to be 26:01.

Can anyone tell me what formula I would use to do this? My boss asked

me
just a few minutes ago!



  #5   Report Post  
JE McGimpsey
 
Posts: n/a
Default

If you've got it formatted the way you want, just subtract:


A1: 8/15/2005 9:30 AM
A2: 8/16/2005 11:31 AM
A3: =A2 - A1 === 26:01


In article ,
"dtencza" wrote:

I realized after I posted this that Cell A2 should say '8/16/2005 11:31 AM'
in my example.

I have the cell formatted the way I want, I just can't get the calculation
correct if the dates span over a day If anyone has made a formula that does
this and can share it, I'd be really grateful.



  #6   Report Post  
Gary's Student
 
Posts: n/a
Default

Your math is O.K. - you just need a factor of 24:

8/16/2005 11:31
8/15/2005 9:30

is really

38580.47986
38579.39583

the difference is:
1.084027778 days
or 26.01666666 hours
--
Gary's Student


"dtencza" wrote:

I realized after I posted this that Cell A2 should say '8/16/2005 11:31 AM'
in my example.

I have the cell formatted the way I want, I just can't get the calculation
correct if the dates span over a day If anyone has made a formula that does
this and can share it, I'd be really grateful.

"JE McGimpsey" wrote:

One way:

Format/Cells/Number/Custom [h]:mm

In article ,
"dtencza" wrote:

I would like to calculate the difference between two dates and times and have
the result be in hh.mm.

So if in Cell A1 I have '8/15/2005 9:30 AM'
and if in Cell A2 I have '8/16/2005 11:17 AM' then...

I would want the result in Cell A3 to be 26:01.

Can anyone tell me what formula I would use to do this? My boss asked me
just a few minutes ago!


  #7   Report Post  
dtencza
 
Posts: n/a
Default

Thanks for writing back so quickly!

I tried that and got 2:01 rather than 26:01. That formula doesn't seem to
be taking into account that it spans a day plus the 2 hours and one minute.
It is missing 24 hours!

"JE McGimpsey" wrote:

If you've got it formatted the way you want, just subtract:


A1: 8/15/2005 9:30 AM
A2: 8/16/2005 11:31 AM
A3: =A2 - A1 === 26:01


In article ,
"dtencza" wrote:

I realized after I posted this that Cell A2 should say '8/16/2005 11:31 AM'
in my example.

I have the cell formatted the way I want, I just can't get the calculation
correct if the dates span over a day If anyone has made a formula that does
this and can share it, I'd be really grateful.


  #8   Report Post  
JE McGimpsey
 
Posts: n/a
Default

That's because you're not using the format I gave you in a previous
post: [h]:mm

In article ,
"dtencza" wrote:

I tried that and got 2:01 rather than 26:01. That formula doesn't seem to
be taking into account that it spans a day plus the 2 hours and one minute.
It is missing 24 hours!

  #9   Report Post  
dtencza
 
Posts: n/a
Default

Thanks, everyone. I've got it now. I had the formatting of the cell wrong.
My ' h ' didn't have the [ ] brackets around it, so it wasn't getting the 24
hours.

Sorry I didn't catch this when John told me about the formatting. Thanks
also to Rag and Gary.

I got an "Attaboy" from the boss thanks to you guys! :)


"Gary's Student" wrote:

Your math is O.K. - you just need a factor of 24:

8/16/2005 11:31
8/15/2005 9:30

is really

38580.47986
38579.39583

the difference is:
1.084027778 days
or 26.01666666 hours
--
Gary's Student


"dtencza" wrote:

I realized after I posted this that Cell A2 should say '8/16/2005 11:31 AM'
in my example.

I have the cell formatted the way I want, I just can't get the calculation
correct if the dates span over a day If anyone has made a formula that does
this and can share it, I'd be really grateful.

"JE McGimpsey" wrote:

One way:

Format/Cells/Number/Custom [h]:mm

In article ,
"dtencza" wrote:

I would like to calculate the difference between two dates and times and have
the result be in hh.mm.

So if in Cell A1 I have '8/15/2005 9:30 AM'
and if in Cell A2 I have '8/16/2005 11:17 AM' then...

I would want the result in Cell A3 to be 26:01.

Can anyone tell me what formula I would use to do this? My boss asked me
just a few minutes ago!

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
time calculation with military time Ron Thetford Excel Worksheet Functions 8 July 29th 05 07:24 PM
Time Calculation in Minutes only ? pgcam Excel Worksheet Functions 1 May 20th 05 04:46 PM
Time Sheet Calculation Help Needed! sax30 Excel Worksheet Functions 2 April 26th 05 08:08 PM
Time Calculation chintu49 Excel Worksheet Functions 2 February 16th 05 02:55 PM
elapsed time calculation rwf Excel Discussion (Misc queries) 1 January 21st 05 04:51 AM


All times are GMT +1. The time now is 08:49 AM.

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

About Us

"It's about Microsoft Excel"