Here's the logic:
If the date calculated by (today's year, month of birthday, day of birthday) is less than 31 days away and more than 0 days away, then subtract today's date from that date to give a number, otherwise return blank ("").
There are only two problems with this formula - one minor, one major. The minor one is that when you get to the birthday being today, it returns blank - you might want it to actually tell you that the birthday is today
. The major one is that if the birthday is in January and today is December, it doesn't work as the years don't match.
The solution to the first is quite simple - first check if the calculated date minus today's date equals 0, like this:
Formula:
=IF(DATE(YEAR($C$1),MONTH(B5),DAY(B5))-$C$1=0,"Birthday!",IF(AND(DATE(YEAR($C$1),MONTH(B5),DAY(B5))-$C$1<31,DATE(YEAR($C$1),MONTH(B5),DAY(B5))-$C$1>0),DATE(YEAR($C$1),MONTH(B5),DAY(B5))-$C$1,""))
The solution to the second is to insert another IF to check if 'today' ($C$1) is in month 12 (december) and if so to add a year to that date in the calculations - giving us the final formula of:
Formula:
=IF(DATE(YEAR($C$1),MONTH(B5),DAY(B5))-$C$1=0,"Birthday!",IF(AND(MONTH($C$1)=12,DATE(YEAR($C$1)+1,MONTH(B5),DAY(B5))-$C$1<31,DATE(YEAR($C$1)+1,MONTH(B5),DAY(B5))-$C$1>0),DATE(YEAR($C$1)+1,MONTH(B5),DAY(B5))-$C$1,IF(AND(DATE(YEAR($C$1),MONTH(B5),DAY(B5))-$C$1<31,DATE(YEAR($C$1),MONTH(B5),DAY(B5))-$C$1>0),DATE(YEAR($C$1),MONTH(B5),DAY(B5))-$C$1,"")))
The logic of the final formula is:
If the date calculated by (today's year, month of birthday, day of birthday) is the same as today's date, return 'Birthday!'. That's this bit:
Formula:
IF(DATE(YEAR($C$1),MONTH(B5),DAY(B5))-$C$1=0,"Birthday!",
If today's date is in December and (next year, month and day of birthday) is <31 and >0 days away, subtract today's date from that date to give the number of days remaining. That's this next bit:
Formula:
IF(AND(MONTH($C$1)=12,DATE(YEAR($C$1)+1,MONTH(B5),DAY(B5))-$C$1<31,DATE(YEAR($C$1)+1,MONTH(B5),DAY(B5))-$C$1>0),DATE(YEAR($C$1)+1,MONTH(B5),DAY(B5))-$C$1,
If (today's year, month and day of birthday) is <31 and >0 days away, subtract today's date from that date to give the number of days remaining. That's the (almost) last bit:
Formula:
IF(AND(DATE(YEAR($C$1),MONTH(B5),DAY(B5))-$C$1<31,DATE(YEAR($C$1),MONTH(B5),DAY(B5))-$C$1>0),DATE(YEAR($C$1),MONTH(B5),DAY(B5))-$C$1,
Finally, if none of the above are true, return blank, then close off the formula with three brackets because there are three IF statements:
Formula:
"")))
I hope the final formula is useful and that the explanation helps a bit.
Happy New Year! 
Edit:
To check for today = birthday, you could use this instead which just checks that the day and month of the birthday are the same as the day and month today:
Formula:
IF(AND(DAY($C$1)=DAY(B5),MONTH($C$1)=MONTH(B5)),"Birthday!",
which would give you a final formula of:
Formula:
=IF(AND(DAY($C$1)=DAY(B5),MONTH($C$1)=MONTH(B5)),"Birthday!",IF(AND(MONTH($C$1)=12,DATE(YEAR($C$1)+1,MONTH(B5),DAY(B5))-$C$1<31,DATE(YEAR($C$1)+1,MONTH(B5),DAY(B5))-$C$1>0),DATE(YEAR($C$1)+1,MONTH(B5),DAY(B5))-$C$1,IF(AND(DATE(YEAR($C$1),MONTH(B5),DAY(B5))-$C$1<31,DATE(YEAR($C$1),MONTH(B5),DAY(B5))-$C$1>0),DATE(YEAR($C$1),MONTH(B5),DAY(B5))-$C$1,"")))
There's no difference in the result.
Lastly, you could replace all the $C$1 references with TODAY() (for example YEAR($C$1) would become YEAR(TODAY()) instead) if you wanted to get rid of the cell containing today's date. The easiest way to do this would be to use Find and Replace. But personally, I'd probably leave it there!
Bookmarks