Convert a four-digit hhmm clock code

Turn the code 0905 into a real time: 9:05 AM.

What you'll make

In Excel: 0905 becomes 9:05 AM.

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"
2RIGHT(A8,2)Takes the last 2 digits: the minutes."30"
3TIME( … )Puts them together as a real time.2:30 PM

Hours use 24-hour numbering, so 14 is 2 PM. The 0 at the end means no seconds.

=TIME(LEFT(A8,2),RIGHT(A8,2),0)

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 four-digit codes like 0930 into the green column of the Template tab. 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, like 0930, and paste codes as text. Codes like 2400 or 1275 roll over to another time instead of turning amber, so check odd ones.

Microsoft's help: TIME function