Spreadsheet Practice

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$1

Build 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 to C6
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$1

Result5

  1. $F$110/29/2026

    The value in F1.

  2. YEAR($F$1)2026

    YEAR: Year of a date.

    • serial_number$F$110/29/2026
  3. B211/3/1990

    The value in B2.

  4. TEXT(B2,"mmdd")"1103"

    TEXT: Formats a number or date as text, e.g. "mmm" or "$#,##0".

    • valueB211/3/1990
    • format_text"mmdd"
  5. 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"
  6. TEXT(B2,"mmdd")<TEXT($F$1,"mmdd")FALSE

    The < operator tests less than.

  7. YEAR($F$1)+(TEXT(B2,"mmdd")<TEXT($F$1,"mmdd")2026

    The + operator adds.

  8. MONTH(B2)11

    MONTH: Month of a date, 1–12.

    • serial_numberB211/3/1990
  9. DAY(B2)3

    DAY: Day of the month, 1–31.

    • serial_numberB211/3/1990
  10. 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.

    • yearYEAR($F$1)+(TEXT(B2,"mmdd")<TEXT($F$1,"mmdd")2026
    • monthMONTH(B2)11
    • dayDAY(B2)3
  11. DATE(YEAR($F$1)+(TEXT(B2,"mmdd")<TEXT($F$1,"mmdd")),MONTH(B2),DAY(B2))-$F$15

    The - 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.

FormulaResultWhen to use it
=EDATE(B2,12*(DATEDIF(B2,$F$1-1,"y")+1))-$F$15, 0, 78…Different resultSteps 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$1 on 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

In 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.