ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Time calculation probolem request (https://www.excelbanter.com/excel-discussion-misc-queries/167595-time-calculation-probolem-request.html)

joecrabtree

Time calculation probolem request
 
To all,

This is probably a very obvious question, but I cant get my head
around it. I have two cells containing the values 22:01:50 and
22:01:42. When I subtract 22:01:42 from 22:01:50, I get 00:00:08.
Which is fine. However I want the 00:00:08 to just read 8. I.e. just a
normal number. Ive tried formating the cells, but this doesn't work.

Is this possible?

Thanks in advance for your help,

Regards

Joseph Crabtree



joeu2004

Time calculation probolem request
 
On Nov 27, 11:28 pm, joecrabtree wrote:
To all,

This is probably a very obvious question, but I cant get my head
around it. I have two cells containing the values 22:01:50 and
22:01:42. When I subtract 22:01:42 from 22:01:50, I get 00:00:08.
Which is fine. However I want the 00:00:08 to just read 8.


If 22:01:50 is in A1 and 22:01:42 is in A2, compute:

=round((A1-A2)*24*3600,0)

and format Number with zero decimal places. You can replace 24*3600
with 86400, the number of seconds in a day. The "problem" is: time
is stored as a fraction of a day.

daddylonglegs

Time calculation probolem request
 
You could also try formatting the result cell as [s]

Note: this only changes the display not the underlying value

"joeu2004" wrote:

On Nov 27, 11:28 pm, joecrabtree wrote:
To all,

This is probably a very obvious question, but I cant get my head
around it. I have two cells containing the values 22:01:50 and
22:01:42. When I subtract 22:01:42 from 22:01:50, I get 00:00:08.
Which is fine. However I want the 00:00:08 to just read 8.


If 22:01:50 is in A1 and 22:01:42 is in A2, compute:

=round((A1-A2)*24*3600,0)

and format Number with zero decimal places. You can replace 24*3600
with 86400, the number of seconds in a day. The "problem" is: time
is stored as a fraction of a day.



All times are GMT +1. The time now is 03:56 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com