=DATEDIF(start_date, end_date, unit)
| Argument | Required | Description |
|---|---|---|
| start_date | Required | The earlier of the two dates. For age calculations this is the date of birth. Must be a valid Excel date — either a cell reference containing a date, or a date entered with DATE(year,month,day). |
| end_date | Required | The later of the two dates. For current age use TODAY(). For age at a specific point use DATE(year,month,day). Must be greater than start_date or DATEDIF returns an error. |
| unit | Required | "Y" returns complete years (standard for age). "M" returns complete months. "D" returns complete days. "YM" returns remaining months after stripping complete years. "MD" returns remaining days after stripping complete months. "YD" returns days since last birthday anniversary. |
| A | B | C | |
|---|---|---|---|
| 1 | Employee | Date of Birth | Age (Years) |
| 2 | Alice Chen | 1990-03-15 | =DATEDIF(B2,TODAY(),"Y") |
| 3 | Bob Smith | 1985-07-22 | 38 |
| 4 | Carol Jones | 2000-11-08 | 23 |
| 5 | David Kim | 1978-01-30 | 46 |
| 6 | Eve Taylor | 1995-04-12 | 29 |
| 7 | Frank Brown | 1988-09-03 | 35 |
| 8 | Grace Lee | 2001-06-17 | 22 |
| 9 | Hank Patel | 1972-12-25 | 51 |
| 10 | Iris Wong | 1998-02-28 | 26 |
| 11 | James Miller | 1983-08-11 | 40 |
| A | B | C | |
|---|---|---|---|
| 1 | Employee | Date of Birth | Age |
| 2 | Alice Chen | 1990-03-15 | =DATEDIF(B2,TODAY(),"Y")&" yr "&DATEDIF(B2,TODAY(),"YM")&" mo" |
| 3 | Bob Smith | 1985-07-22 | 38 yr 8 mo |
| 4 | Carol Jones | 2000-11-08 | 23 yr 4 mo |
| 5 | David Kim | 1978-01-30 | 46 yr 2 mo |
| 6 | Eve Taylor | 1995-04-12 | 28 yr 11 mo |
| 7 | Frank Brown | 1988-09-03 | 35 yr 7 mo |
| 8 | Grace Lee | 2001-06-17 | 22 yr 9 mo |
| 9 | Hank Patel | 1972-12-25 | 51 yr 3 mo |
| 10 | Iris Wong | 1998-02-28 | 26 yr 1 mo |
| 11 | James Miller | 1983-08-11 | 40 yr 7 mo |
=IF(DATEDIF(B2,TODAY(),"Y")>=18,"Eligible","Under 18")
=DATEDIF(C2,TODAY(),"Y")
=DATEDIF(B2,TODAY(),"Y")&" yr "&DATEDIF(B2,TODAY(),"YM")&" mo"
=IF(DATEDIF(D2,TODAY(),"M")>12,"Renewal due","Active")
=DATEDIF(B2,DATE(2024,9,1),"Y")
=DATEDIF(B2,TODAY(),"Y")&" years "&DATEDIF(B2,TODAY(),"YM")&" months"
=DATEDIF(B2,DATE(2024,9,1),"Y")
=DATEDIF(B2,TODAY(),"Y")&" years"