ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Format into Time. (https://www.excelbanter.com/excel-discussion-misc-queries/235565-format-into-time.html)

GEM

Format into Time.
 
In column A I have a list of about 1000 numbers going down, A1, A2, A3, etc.
The numbers represent seconds.
A1=35 (35 seconds)
A2=108 (108 seconds)
etc...

How can I modify format these numbers to the following,

108 seconds = 1:48 (1 minute, 48 seconds)



Bob Phillips[_3_]

Format into Time.
 
You can't directly, you will need

=A1/86400

in B1 and format that as time.


--
__________________________________
HTH

Bob

"GEM" wrote in message
...
In column A I have a list of about 1000 numbers going down, A1, A2, A3,
etc.
The numbers represent seconds.
A1=35 (35 seconds)
A2=108 (108 seconds)
etc...

How can I modify format these numbers to the following,

108 seconds = 1:48 (1 minute, 48 seconds)





jamescox[_24_]

Format into Time.
 

Assuming your values in column A are numbers

=TEXT(A1/86400,"HH:MM:SS")

will give you the time as a text (drop the HH portion of the format
string if you don't want to show hours)

If you need these a datetimes for other date operations, use

=A1/86400

and use Format Cells, Custom, and enter hh:mm:ss in the Type box.

You may see some undesired results when the value in Col A gets larger
than 86400 seconds - the value will 'wrap' back to 00:00:00 at 86400 and
start again.


--
jamescox
------------------------------------------------------------------------
jamescox's Profile: http://www.thecodecage.com/forumz/member.php?userid=449
View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=111844



All times are GMT +1. The time now is 02:19 PM.

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