convert variable number (time stamp) to time format

cmacnab

New Member
Joined
Jun 24, 2013
Messages
31
Hi, I have a report that gives me the time stamp of a transaction in the format of a number. The format is hours, minutes, seconds and milliseconds. I'm trying to covert this to a time format however the number of digits varies (from 4 to 8 digits). For example:


9494300 would be 9:49:43:00AM
253800 would be 00:25:38:00AM
60300 would be 00:06:03:00AM
2400 would be 00:00:24:00AM
12473600 would be 12:47:36:00PM16094500 would be 16:09:45:00PM

I'm trying to find a formula to convert all of these variable numbers to 00:00:00:00AM or PM. I could easily lose the last 2 zeros as they aren't important. Can someone help with this.

Thanks in advance.
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.

shg

MrExcel MVP
Joined
May 7, 2008
Messages
21,784
Office Version
  1. 2010
Platform
  1. Windows
a​
b​
c​
2​
9494300​
9:49:43 am​
b2: =--text(a2/100, "00\:00\:00")
3​
253800​
12:25:38 am​
4​
60300​
12:06:03 am​
5​
2400​
12:00:24 am​
6​
12473600​
12:47:36 pm​
7​
16094500​
4:09:45 pm​
 
Solution

Watch MrExcel Video

Forum statistics

Threads
1,129,685
Messages
5,637,808
Members
416,983
Latest member
LessThanAverageUser

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
Top