The core of the problem is to compare the given birthday to the current date while ignoring the year.

There are two main ways to approach the problem.

This works fine, but the formula is a bit more complex.

Excel formula: Get age from birthday

This solution is a bit more elegant.

Both methods are described below.

MONTH returns 5 for a date in May) .

Excel formula: Count birthdays by month

TheDAY functionreturns the day portion of a date.

TheTODAY functionreturns the current date.

Essentially, the logical expressions inside the AND function check to see if the month and day both match.

Excel formula: Sort birthdays by month and day

We purposely ignore the year for birthdays, since the year only matches in the first year of birth.

When AND returns TRUE,the IF function will return “Happy Birthday!”

This formula works fine, but the TEXT function can streamline the formula somewhat, as explained below.

Excel formula: List upcoming birthdays

TEXT function

TheTEXT functioncan also be used to solve this problem in a more elegant way.

The TEXT function is used to applycustom number formatsinside a formula.

The logical test returns TRUE and the IF function returns “Happy Birthday!”

Excel TEXT function

in a text string with the number format of your choice.

The TODAY function takes no arguments.

it’s possible for you to format the value returned by TODAY with a datenumber format.

Excel TODAY function

More than one condition can be tested by nesting IF functions.

AND returns TRUEonly if all the conditions are met.

If any conditions are not met, the AND function returns FALSE.

Excel IF function

Excel AND function

Excel MONTH function

Excel DAY function