0
0
Excelspreadsheet~5 mins

DATEDIF for date differences in Excel - Step-by-Step Guide

Choose your learning style9 modes available
Introduction
DATEDIF helps you find the difference between two dates in days, months, or years. It is useful when you want to know how much time has passed between two events, like calculating age or project duration.
When you want to calculate a person's age from their birthdate and today's date.
When you need to find how many months have passed between a project start and end date.
When you want to know the exact number of days between two appointments.
When you want to calculate the number of complete years between two dates for service duration.
When you want to track how many months remain until a deadline.
Steps
Step 1: Click
- a blank cell where you want the result
The cell is selected and ready for typing
Step 2: Type
- the formula bar
The formula appears in the cell as you type
💡 Start typing =DATEDIF( to see the function suggestions
Step 3: Enter
- the formula: =DATEDIF(start_date, end_date, unit)
The cell shows the difference between the two dates based on the unit you choose
💡 Replace start_date and end_date with cell references or dates in quotes, and unit with "d", "m", or "y"
Step 4: Press Enter
- after typing the formula
Excel calculates and displays the date difference
Before vs After
Before
Cell A1 has 2023-01-01, Cell B1 has 2024-06-01, Cell C1 is empty
After
Cell C1 shows 517 when formula =DATEDIF(A1, B1, "d") is entered
Settings Reference
start_date
📍 inside the DATEDIF formula
The earlier date to start counting from
Default: none
end_date
📍 inside the DATEDIF formula
The later date to count up to
Default: none
unit
📍 inside the DATEDIF formula
Defines how the difference is measured
Default: none
Common Mistakes
Using end_date before start_date
DATEDIF returns an error if the start date is after the end date
Always put the earlier date first as start_date and the later date second as end_date
Typing unit without quotes
The unit must be a text string in quotes, otherwise Excel shows an error
Always put the unit inside double quotes, like "d", "m", or "y"
Using DATEDIF with invalid dates or text
If dates are not valid Excel dates, the formula will not calculate correctly
Make sure start_date and end_date are valid dates or cell references containing dates
Summary
DATEDIF calculates the difference between two dates in days, months, or years.
You must enter the earlier date first and the later date second.
The unit argument must be a text string in quotes: "d", "m", or "y".