Read a date between two markers

Pull the date out of <dob>2026-11-04</dob> as a real date: November 4, 2026.

What you'll make

In Excel: <dob>2026-11-04</dob> becomes November 4, 2026.

The formula

The formula, with a numbered bracket under each part.
NumberPartWhat it doesResult so far
1A8The exported text that holds the date."<dob>2026-11-04</dob>"
2TEXTAFTER( … ,B8)Keeps what comes after the opening marker."2026-11-04</dob>"
3TEXTBEFORE( … ,C8)Keeps what comes before the closing marker."2026-11-04"
4DATEVALUE( … )Reads the text and turns it into a real date.November 4, 2026

Each bracket wraps the one above it, so Excel works from the inside out.

=DATEVALUE(TEXTBEFORE(TEXTAFTER(A8,B8),C8))

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. Paste the text into column A of the Template tab and its two markers into columns B and C. The dates fill in by themselves.
  3. Move them into your letter. Copy the results. Then use Paste Special and choose Values.

Before you send

Markers must match the text exactly, capitals and spaces included. If the field appears twice, only the first one is read.

Microsoft's help: TEXTAFTER function