Explanation

In this example, the goal is to return a number, 1-12, for any month name of the year. For example, given the string “January” we want to return 1, “February” should return 2, and so on. If we had a valid Excel date , we could use a number format for this task, but because we are starting with a text string , we need another way. The approach we take in this example is to create a date fragment that can be correctly interpreted by Excel as a valid date. In the example shown, the formula in cell C5 is:

=MONTH(B5&1) // returns 1

Working from the inside out, we start by concatenating the name in cell B5 to the number 1:

B5&1 // returns "January1"

This expression returns a string like “January1”, “February1”, “March1”,and so on. It turns out, that if we pass a date fragment like this into the MONTH function , it will coerce the string to a valid date, using the current year. As I write this, the year is 2021, so the result for January is the date January 1, 2021, represented in Excel as the serial number 44197.

After this date has been created, the MONTH function returns the correct month number for the date that was created using concatenation. In each case, the actual date value is a “throwaway”, used only as a convenient value to pass into the MONTH function. In B5 the evaluation works like this (in the year 2021):

=MONTH(B5&1)
=MONTH("January1")
=MONTH(44197)
=1

Date evaluation

This example is a bit tricky in that the evaluation of the date inside the MONTH function is automatic. If you use the expression that concatenates the month name to 1 outside the MONTH function, you’ll need to add an extra step to get Excel to convert the text to a date. The DATEVALUE function or adding zero are both good options:

=DATEVALUE(B5&1)
=(B5&1)+0

Both will return a date serial number, which must then be formatted as a date.

Explanation

Working from the inside out, we use the DATEDIF function to calculate how many complete years are between the original anniversary date and the “as of” date, where the as of date is any date after the anniversary date:

DATEDIF(B5,C5,"y")

Note: in this case, we are arbitrarily fixing the “as of” date as June 1, 2017 in all examples.

Because we are interested in the next anniversary date, we add 1 to the DATEDIF result, then multiply by 12 to convert to years to months.

Next, the month value goes into the EDATE function, with the original date from column B. The EDATE function rolls the original date forward by the number of months given in the previous step which creates the next upcoming anniversary date.

As of today

To calculate the next anniversary as of today, use the TODAY() function for the “as of” date:

=EDATE(date,(DATEDIF(date,TODAY(),"y")+1)*12)