Create a timestamp filename label

Turn November 4, 2026 2:30:15 PM into 20261104_143015, with no slashes or colons.

What you'll make

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

The formula

The formula, with a numbered bracket under each part.
NumberPartWhat it doesResult so far
1A8The real date and time.November 4, 2026 2:30:15 PM
2"yyyymmddWrites the date as year, month, day with no gaps."20261104"
3""_""Adds an underscore between date and time."20261104_"
4hhmmss"Adds the time: hours 00 to 23, minutes, seconds."20261104_143015"
5TEXT( … )Writes the date and time in that pattern as text."20261104_143015"

Parts 2 to 4 are one pattern. The doubled quotes keep the underscore as a plain mark.

=TEXT(A8,"yyyymmdd""_""hhmmss")

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 into the green column of the Template tab. The labels fill in by themselves.
  3. Move them into your letter. Copy the results. Then use Paste Special and choose Values.

Before you send

Two times in the same second get the same label. Add something extra if each name must differ.

Microsoft's help: TEXT function