ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Convert from seconds to mm:ss within a cell (https://www.excelbanter.com/excel-programming/304266-convert-seconds-mm-ss-within-cell.html)

Janet

Convert from seconds to mm:ss within a cell
 
Hi, I need help.

trying to convert seconds i.e. 127 to read 2:07 while
still in the same cell.

Anyone know how to do this or even if it is possible
without writing VB code? TX

Tom Ogilvy

Convert from seconds to mm:ss within a cell
 
There is no formatting that will display the number 127 as 2:07. If you use
another cell you can divide 127/(60*60*24)

and format as Time.


if you mean a macro

Sub Tester1()
ActiveCell.Value = ActiveCell.Value / (60# * 60# * 24#)
ActiveCell.NumberFormat = "mm:ss"
End Sub



--
Regards,
Tom Ogilvy


"Janet" wrote in message
...
Hi, I need help.

trying to convert seconds i.e. 127 to read 2:07 while
still in the same cell.

Anyone know how to do this or even if it is possible
without writing VB code? TX




Frank Kabel

Convert from seconds to mm:ss within a cell
 
Hi
without VBA this is not possible within the same cell. ne
workaround: Use a helper column with the formula
=A1/(24*60)
and format this cell as time

-----Original Message-----
Hi, I need help.

trying to convert seconds i.e. 127 to read 2:07 while
still in the same cell.

Anyone know how to do this or even if it is possible
without writing VB code? TX
.



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

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