Written and reviewed by FormulaCraft Team. Each formula on this page is run through our verification engine before publishing.
Last reviewed:
DATEDIF computes the difference between a start date and an end date according to a unit code: "Y" for complete years, "M" for complete months, "D" for days, "YM" for months ignoring years, "MD" for days ignoring months and years, and "YD" for days ignoring years. Though undocumented in newer Excel versions, it is widely supported and is the standard way to calculate precise age or tenure.
Topic:Date arithmetic=DATEDIF(A2,B2,"Y")=DATEDIF(A2,B2,"Y")Edit the grid or formula, then run it through a real spreadsheet engine — no signup.
Sample data — click any cell to edit
Need a version for your data?
Try: “Calculate each employee's age in complete years from their date of birth”
Work with the current date and measure the gap between two dates.
How-toTurn a birth date into an age in years with DATEDIF and TODAY. Works the same in Excel and Google Sheets.
How-toSubtract one date from another to get the number of days, or count working days with NETWORKDAYS. Works in both apps.
How-toShift a date forward or back by a number of months with EDATE — it handles month lengths correctly. Works in both apps.
How-toMark rows whose due date has passed by comparing it to TODAY() with IF. Works the same in Excel and Google Sheets.
How-toUse DATEDIF with TODAY() to calculate a person's exact age in years from a birth date cell in Excel and Google Sheets.
Written and reviewed by FormulaCraft Team. Each formula on this page is run through our verification engine before publishing.
Last reviewed: