Date Functions
DATE, DATEDIF, DAYS, and TODAY: building, measuring, and comparing dates.
DATE assembles a real date out of separate year, month, and day numbers, which comes up constantly when a data export splits a date into three columns instead of one. DAYS and DATEDIF both measure the gap between two dates, but in different units: DAYS always counts in whole days, while DATEDIF can report that same gap in whole months or whole years, which is what tenure, age, and subscription-length questions actually want. TODAY takes no arguments at all and always returns whatever the current date is, so any formula built around it stays correct every time the sheet is reopened.
LearnExcel shows dates as plain YYYY-MM-DD text rather than Excel's internal date-serial number, but every function here behaves exactly the way it would in real Excel.
Syntax
| Argument | Description |
|---|---|
| year, month, day | Required for DATE. Three separate numbers that combine into one date. |
| end_date, start_date | Required for DAYS. The gap in days, end minus start. |
| unit | Required for DATEDIF. "d" for whole days, "m" for whole months, "y" for whole years. |
| (TODAY) | TODAY takes no arguments. It returns whatever the current date is when the formula runs. |
A real example: years of tenure that respects the actual anniversary
A hire date compared against today, where the answer needs to be whole years, not a rough estimate:
DATEDIF doesn't just subtract the year numbers; it correctly holds back a year until the actual anniversary date has passed, which is the detail that makes it the right choice over a plain YEAR(B2)-YEAR(A2) subtraction.
Worked examples
| A | B | C | |
|---|---|---|---|
| 1 | Year | Month | Day |
| 2 | 2026 | 3 | 15 |
| A | B | |
|---|---|---|
| 1 | Start | End |
| 2 | 2026-02-01 | 2026-02-09 |
| A | B | |
|---|---|---|
| 1 | Hire date | Today |
| 2 | 2019-03-10 | 2026-03-01 |
(not 7; this year's anniversary hasn't happened yet)
Common mistakes
- Passing DAYS its two dates in the wrong order. It's end_date first, then start_date, even though the opposite order feels natural to type.
- Expecting DATEDIF's "y" unit to just subtract the years. It correctly holds back a year until the actual anniversary date has passed.
- Typing a date as text in a format DATEDIF/DAYS don't recognize. LearnExcel expects YYYY-MM-DD exactly.
Related functions
Try it yourself
A free, graded practice exercise using this exact function: instant feedback, no signup required.
Practice date functions →