Convert Seconds into Hours:Minutes:Seconds

Tyndie

New Member
Joined
Jun 16, 2008
Messages
10
Hi,

Is there an easy way of converting seconds from using a time into hours, minutes, seconds please?
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
Try

=A1/86400

and format the result cell as Time. Note that 86400 is the number of seconds in a day (24*60*60).
 
Upvote 0
Do you wish to apply this to a range of values? ie you have seconds values in A1:A100 that you want converted? In which case record a macro of you performing a PasteSpecial>Operation: Divide on the cells with 86400.
 
Upvote 0
Something like this

Code:
Sub test()
Const SecinDay As Long = 86400
Dim iSec As Long, MyTime As Date
iSec = 30000
MyTime = iSec / SecinDay
MsgBox MyTime
End Sub
 
Upvote 0
I am using a timer to calculate the time a macro executes and then the time it executes to be in the status bar, but it shows it in seconds, and the script can run for several hours.
 
Upvote 0
Try this

Code:
Sub test2()
Dim i As Long, t As Date
t = Now
For i = 1 To 100000
    Application.StatusBar = Format(Now - t, "hh:mm:ss")
Next i
Application.StatusBar = False
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,641
Messages
6,120,685
Members
448,978
Latest member
rrauni

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top