Format a birth date at known precision

1998 stays 1998, 2001-11 becomes November 2001, and full dates print in full.

What you'll make

In Excel: 1998 stays 1998; 2001-11 becomes November 2001.

The formula

The formula, with a numbered bracket under each part.
NumberPartWhat it doesResult so far
1s,SUBSTITUTE(A8,"-","")Removes the hyphens. LET calls this s."200111"
2n,LEN(s)Counts the digits in s. LET calls this n.6
3IF(n=6, … )6 digits: month and year. Otherwise the full date."November 2001"
4IF(OR( … ),A8, … )A year alone, or before 1901, stays as typed."November 2001"
5LET( … )Works out s and n once, then uses them."November 2001"

Excel works from the inside out. The day 1 only helps write the month name; it isn't printed.

=LET(s,SUBSTITUTE(A8,"-",""),n,LEN(s),IF(OR(n=4,VALUE(LEFT(s,4))<1901),A8,IF(n=6,TEXT(DATE(LEFT(s,4),RIGHT(s,2),1),"mmmm yyyy"),TEXT(DATE(LEFT(s,4),MID(s,5,2),RIGHT(s,2)),"mmmm d, yyyy"))))

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 birth dates like 1998, 2001-11 or 1995-03-09 into the green column of the Template tab. The readable dates fill in by themselves.
  3. Move them into your letter. Copy the results. Then use Paste Special and choose Values.

Before you send

Months and days need two digits. A value like 2001-1 prints the wrong date, so check short ones.

Microsoft's help: LET function