Convert an mmyy valid-through code

Turn the code 1126 and the century 2000 into a real date: November 30, 2026.

What you'll make

In Excel: 0224 + 2000 becomes February 29, 2024.

The formula

The formula, with a numbered bracket under each part.
NumberPartWhat it doesFor row 8
1B8The century you choose, like 1900 or 2000.2000
2RIGHT(A8,2)Takes the last 2 digits and adds the century.2026
3LEFT(A8,2)Takes the first 2 digits: the month."11"
4DATE( … )Makes the 1st of that month.November 1, 2026
5EOMONTH( … )Finds the last day of that month.November 30, 2026

Excel works from the inside out. The 1 inside DATE is day 1, and the 0 keeps the same month.

=EOMONTH(DATE(B8+RIGHT(A8,2),LEFT(A8,2),1),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 dates. Paste four-digit codes like 1126 and their century, like 2000, into the green columns of the Template tab. 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

Use this only when the code means valid through the end of that month. Choose the century for each row yourself: 1900 turns 99 into 1999, and 2000 turns 26 into 2026.

Microsoft's help: EOMONTH function