Export milliseconds with an offset

Turn 11/4/2026 14:30:15.123 and -05:00 into the text 2026-11-04T14:30:15.123-05:00.

What you'll make

In Excel: 11/4/2026 14:30:15.123, -05:00 becomes 2026-11-04T14:30:15.123-05:00.

The formula

The formula, with a numbered bracket under each part.
NumberPartWhat it doesResult so far
1A8The real local date and time.11/4/2026 14:30:15.123
2"yyyy-mm-dd""T""hh:mm:ss.000"The pattern: date, a T, 24-hour time, milliseconds."yyyy-mm-ddThh:mm:ss.000"
3TEXT( … )Writes the date and time in that pattern as text."…T14:30:15.123"
4&B8Adds the offset exactly as typed."…T14:30:15.123-05:00"

The doubled quotes keep T as a plain letter. The offset is only added; the time doesn't move.

=TEXT(A8,"yyyy-mm-dd""T""hh:mm:ss.000")&B8

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 dates and times. Paste real dates and times, and each one's offset like -05:00, into the green columns of the Template tab. The export text fills in by itself.
  3. Move them into your letter. Copy the results. Then use Paste Special and choose Values.

Before you send

Check each offset matches its own time and date. The formula adds it as typed; it doesn't convert.

Microsoft's help: TEXT function