#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 119
Default ADDING TIMES

I would like to add hours in a worksheet to come up with a total number of
hours. However, when I add something like this:

5:00
5:00
5:00
5:00
5:30

.. . . the answer is 1:30. So excel is taking 25 hours and 30 minutes and
representing as 1:30.

How can I get excel to return the total hours total as hours (25:30)?

Thanks
--
William
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,268
Default ADDING TIMES

You use the wrong format, use [h]:mm


--


Regards,


Peo Sjoblom



"William" wrote in message
...
I would like to add hours in a worksheet to come up with a total number of
hours. However, when I add something like this:

5:00
5:00
5:00
5:00
5:30

. . . the answer is 1:30. So excel is taking 25 hours and 30 minutes and
representing as 1:30.

How can I get excel to return the total hours total as hours (25:30)?

Thanks
--
William



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 257
Default ADDING TIMES

They gave you the right answer, as far as it went, William, but maybe you'd
like to know WHY. In case you haven't figured it out already, Excel was
displaying the number of hours you get when you add those times: that is,
25:30 is one day, one hour and thirty minutes. But in the format for that
cell, Excel was displaying only the hours and minutes; probably the format
was set to "h:mm".

Excel gives you a lot of flexibility in displaying timestamps. Behind the
scenes what it had was 0.208333, 0.208333, 0.208333, 0.208333 and 0.229167
(all those are the correct fractions of days), and it added them up to 1.0625
days. You can display that in a number of ways:

Format string Resulting display
"d h:mm" 1 1:30
"yyyy-mm-dd" 1900-01-01
"yyyy-mm-dd hh:mm:ss" 1900-01-01 01:30:00
"ddd dd-mmm-yy hh:mm" Sun 01-Jan-00 01:30
"[h]:mm:ss" 25:30:00
"[hhh]:mm" 025:30
"dddd hh:mm" Sunday 01:30

....and so on. The trick is to realize that behind the scenes, Excel thinks
time began the midnight before Jan 0, 1900 and interprets all times as
durations from there, so 1.0625 days equals 1:30 in the morning of Sunday,
Jan 1, 1900. If you want to display the total hours, not just the time of
the last day of that "duration", you have to use a format string with square
brackets around the hour portion. (By that measure, it has been 953257:18:20
hours since the beginning of time as I write this.)

--- "William" wrote:
I would like to add hours in a worksheet to come up with a total number of
hours. However, when I add something like this:

5:00
5:00
5:00
5:00
5:30

. . . the answer is 1:30. So excel is taking 25 hours and 30 minutes and
representing as 1:30.

How can I get excel to return the total hours total as hours (25:30)?

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 119
Default ADDING TIMES

Thank you all for the replies. Bob Bridges, thanks especially for taking the
time to provide the explanation. It was very much appreciated.

Best to all.
--
William


"Bob Bridges" wrote:

They gave you the right answer, as far as it went, William, but maybe you'd
like to know WHY. In case you haven't figured it out already, Excel was
displaying the number of hours you get when you add those times: that is,
25:30 is one day, one hour and thirty minutes. But in the format for that
cell, Excel was displaying only the hours and minutes; probably the format
was set to "h:mm".

Excel gives you a lot of flexibility in displaying timestamps. Behind the
scenes what it had was 0.208333, 0.208333, 0.208333, 0.208333 and 0.229167
(all those are the correct fractions of days), and it added them up to 1.0625
days. You can display that in a number of ways:

Format string Resulting display
"d h:mm" 1 1:30
"yyyy-mm-dd" 1900-01-01
"yyyy-mm-dd hh:mm:ss" 1900-01-01 01:30:00
"ddd dd-mmm-yy hh:mm" Sun 01-Jan-00 01:30
"[h]:mm:ss" 25:30:00
"[hhh]:mm" 025:30
"dddd hh:mm" Sunday 01:30

...and so on. The trick is to realize that behind the scenes, Excel thinks
time began the midnight before Jan 0, 1900 and interprets all times as
durations from there, so 1.0625 days equals 1:30 in the morning of Sunday,
Jan 1, 1900. If you want to display the total hours, not just the time of
the last day of that "duration", you have to use a format string with square
brackets around the hour portion. (By that measure, it has been 953257:18:20
hours since the beginning of time as I write this.)

--- "William" wrote:
I would like to add hours in a worksheet to come up with a total number of
hours. However, when I add something like this:

5:00
5:00
5:00
5:00
5:30

. . . the answer is 1:30. So excel is taking 25 hours and 30 minutes and
representing as 1:30.

How can I get excel to return the total hours total as hours (25:30)?

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
Adding Times LiAD Excel Worksheet Functions 7 September 10th 08 02:10 PM
adding times Damien Excel Discussion (Misc queries) 5 August 18th 07 10:56 AM
adding times again B Bear New Users to Excel 14 August 30th 06 09:58 AM
adding times together changetires Excel Discussion (Misc queries) 4 June 30th 06 01:40 PM
Adding times Jim Excel Worksheet Functions 2 July 13th 05 03:22 AM


All times are GMT +1. The time now is 08:40 PM.

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"