Time calculation (in hh.mm) spanning more than one day

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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!
 
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 said:
One way:

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

dtencza said:
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!
 
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 said:
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 said:
One way:

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

dtencza said:
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!
 
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
 
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 said:
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 said:
One way:

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

dtencza said:
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!
 
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!
 
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 said:
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 said:
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 said:
One way:

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

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!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top