Convert a six-digit hhmmss clock code

Turn the code 143015 into a real time: 2:30:15 PM.

What you'll make

In Excel: 143015 becomes 2:30:15 PM.

The formula

The formula, with a numbered bracket under each part.
NumberPartWhat it doesResult so far
1LEFT(A8,2)Takes the first 2 digits: the hour."14"
2MID(A8,3,2)Takes 2 digits from the 3rd: the minutes."30"
3RIGHT(A8,2)Takes the last 2 digits: the seconds."15"
4TIME( … )Puts them together as a real time.2:30:15 PM

Read it left to right. Hours use 24-hour numbering, so 14 is 2 PM and 00 is midnight.

=TIME(LEFT(A8,2),MID(A8,3,2),RIGHT(A8,2))

How to use it

Yellow bar at the top? Click Enable Editing.

  1. See it work. The Example tab shows 20 made-up examples with the formula already in.
  2. Use your own times. Paste six-digit codes like 093015 into the green column of the Template tab. Keep the leading zero. The times fill in by themselves.
  3. Move them into your letter. Copy the results. Then use Paste Special and choose Values.

Before you send

Keep the leading zero: 093015 needs all six digits. A code like 240000 or 236000 rolls over, so check odd times.

Microsoft's help: TIME function