How to calculate the days until the next birthday in Excel
Formula (Excel and Google Sheets)
=DATE(YEAR($F$1)+(TEXT(B2,"mmdd")<TEXT($F$1,"mmdd")),MONTH(B2),DAY(B2))-$F$1Build this year's birthday, move it to next year if it has passed, and subtract today: =DATE(YEAR($F$1)+(TEXT(B2,"mmdd")<TEXT($F$1,"mmdd")),MONTH(B2),DAY(B2))-$F$1.
- Result on the example
- one result per row in
C2, filled down toC6 - Works in
- Every current version
- Google Sheets
- Same formula
See it work
The formula is already in C2, filled down to C6. Change any input and the result updates, or edit the formula to experiment.
How it works
TEXT(…,"mmdd") turns both dates into month-day codes like 1103 and 1029, so comparing them tells you whether this year's birthday has passed. If it has, the comparison is TRUE, which adds 1 to the year. Subtracting today gives the days to go: 0 for Omar, whose birthday is today.
=DATE(YEAR($F$1)+(TEXT(B2,"mmdd")<TEXT($F$1,"mmdd")),MONTH(B2),DAY(B2))-$F$1Result5
$F$110/29/2026The value in F1.
YEAR($F$1)2026YEAR: Year of a date.- serial_number
$F$110/29/2026
- serial_number
B211/3/1990The value in B2.
TEXT(B2,"mmdd")"1103"TEXT: Formats a number or date as text, e.g. "mmm" or "$#,##0".- value
B211/3/1990 - format_text
"mmdd"
- value
TEXT($F$1,"mmdd")"1029"TEXT: Formats a number or date as text, e.g. "mmm" or "$#,##0".- value
$F$110/29/2026 - format_text
"mmdd"
- value
TEXT(B2,"mmdd")<TEXT($F$1,"mmdd")FALSEThe < operator tests less than.
YEAR($F$1)+(TEXT(B2,"mmdd")<TEXT($F$1,"mmdd")2026The + operator adds.
MONTH(B2)11MONTH: Month of a date, 1–12.- serial_number
B211/3/1990
- serial_number
DAY(B2)3DAY: Day of the month, 1–31.- serial_number
B211/3/1990
- serial_number
DATE(YEAR($F$1)+(TEXT(B2,"mmdd")<TEXT($F$1,"mmdd")),MONTH(B2),DAY(B2))11/3/2026 (46329)DATE: Builds a date from parts.- year
YEAR($F$1)+(TEXT(B2,"mmdd")<TEXT($F$1,"mmdd")2026 - month
MONTH(B2)11 - day
DAY(B2)3
- year
DATE(YEAR($F$1)+(TEXT(B2,"mmdd")<TEXT($F$1,"mmdd")),MONTH(B2),DAY(B2))-$F$15The - operator subtracts.
In Google Sheets
The same formula works in Google Sheets: =DATE(YEAR($F$1)+(TEXT(B2,"mmdd")<TEXT($F$1,"mmdd")),MONTH(B2),DAY(B2))-$F$1. We ran it in Google Sheets mode on the same data and it returns the same results.
Other ways to do it
Each one was run on the same example sheet.
| Formula | Result | When to use it |
|---|---|---|
| =EDATE(B2,12*(DATEDIF(B2,$F$1-1,"y")+1))-$F$1 | 5, 0, 78…Different result | Steps the birth date forward by whole years with EDATE; a February 29 birthday falls on February 28 in common years. Ivy's birthday counts as February 28, one day earlier. |
Common mistakes
- With DATE, a February 29 birthday becomes March 1 in common years. If yours should be February 28, use the EDATE version.
DATE(YEAR($F$1),MONTH(B2),DAY(B2))-$F$1on its own goes negative once the birthday has passed.
Try it yourself
Same data, empty answer cell. Your formula is graded instantly, then re-checked on changed data, so a typed-in number won't pass.
Calculate the days until the next birthday
C2, calculate the days from the date in F1 to each person's next birthday (0 if it is today), and fill down to C6.Questions
How do I show the age they will turn?
=DATEDIF(B2,$F$1-1,"y")+1: 42 for Omar today, 36 for Grace on November 3.
How do I list the birthdays in the next 30 days?
=FILTER(A2:A6,C2:C6<=30), using the days-until column.
Checked by running on 2026-10-30: every formula and result on this page was calculated by the Spreadsheet Practice formula engine, in both Excel and Google Sheets modes.