Join date and time codes, skip zeros

Turn 20261104 and 143015 into November 4, 2026 2:30:15 PM. 00000000 stays blank.

What you'll make

In Excel: 20261104 + 143015 becomes November 4, 2026 2:30:15 PM.

The formula

The formula, with a numbered bracket under each part.
NumberPartWhat it doesResult so far
1A8="00000000"Checks if the date code is all zeros.FALSE
2DATE( … )Reads the year, month and day as a real date.November 4, 2026
3TIME( … )Adds the hour, minutes and seconds.November 4, 2026 2:30:15 PM
4IF( … )Leaves all zeros blank, otherwise shows parts 2 and 3.November 4, 2026 2:30:15 PM

Read it left to right. Some systems write 00000000 for a date nobody filled in, so it stays blank.

=IF(A8="00000000","",DATE(LEFT(A8,4),MID(A8,5,2),RIGHT(A8,2))+TIME(LEFT(B8,2),MID(B8,3,2),RIGHT(B8,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 codes. Paste date codes like 20261104 into the first green column and time codes like 143015 into the second. The dates and 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 both codes as text so leading zeros stay. A time of 000000 shows as midnight, so check it really means midnight.

Microsoft's help: DATE function