jdellasala
Well-known Member
- Joined
- Dec 11, 2020
- Messages
- 755
- Office Version
- 365
- Platform
- Windows
- Mobile
- Web
I don't remember how, but a couple of years back I discovered the DATEDIF function.
You won't find it Excel's Functions lists, when you type "=DATEDIF" TAB will not add a opening parenthesis, and provides no parameter information. Yet, when you type "=DATEDIF(" with the opening parenthesis, it will appear in the Tool Tip, and you can click on the Tool Tip name to get the function's help!
It's even on the Microsoft Support site!
I THINK it is a holdover from Lotus 123 compatibility, but don't know for sure. However, I really like this function, and it provides information that is otherwise more cumbersome to get:
With it, you can easily do fun stuff like this:
And no, that is not my birthday.
Anyone else familiar with this function? Know about its history or why it's not officially supported?
You won't find it Excel's Functions lists, when you type "=DATEDIF" TAB will not add a opening parenthesis, and provides no parameter information. Yet, when you type "=DATEDIF(" with the opening parenthesis, it will appear in the Tool Tip, and you can click on the Tool Tip name to get the function's help!
It's even on the Microsoft Support site!
I THINK it is a holdover from Lotus 123 compatibility, but don't know for sure. However, I really like this function, and it provides information that is otherwise more cumbersome to get:
Book1 | |||||
---|---|---|---|---|---|
A | B | C | |||
1 | 01/01/2021 | 12/18/2022 | DATEDIF( start_date, end_date, unit ) | ||
2 | Parameter | Value | Meaning | ||
3 | Y | 1 | The number of complete years in the period. | ||
4 | M | 23 | The number of complete months in the period. | ||
5 | D | 716 | The number of days in the period. | ||
6 | MD | 17 | The difference between the days in start_date and end_date. The months and years of the dates are ignored. Important: We don't recommend using the "MD" argument, as there are known limitations with it. See the known issues section below. | ||
7 | YM | 11 | The difference between the months in start_date and end_date. The days and years of the dates are ignored | ||
8 | YD | 351 | The difference between the days of start_date and end_date. The years of the dates are ignored. | ||
Sheet1 |
Cell Formulas | ||
---|---|---|
Range | Formula | |
B1 | B1 | =TODAY() |
B3:B8 | B3 | =DATEDIF($A$1,$B$1,A3) |
With it, you can easily do fun stuff like this:
Book1 | ||||
---|---|---|---|---|
D | E | |||
12 | 09/07/1973 | You are 17,999 days old! | ||
13 | 12/18/2022 | That is 49 Years, 3 Months, 11 Days Old! | ||
Sheet1 |
Cell Formulas | ||
---|---|---|
Range | Formula | |
E12 | E12 | ="You are "&TEXT(DATEDIF(D12,D13,"D"),"#,###")&" days old!" |
D13 | D13 | =TODAY() |
E13 | E13 | ="That is "&DATEDIF(D12,D13,"Y")&" Years, "&DATEDIF(D12,D13,"YM")&" Months, "&DATEDIF(D12,D13,"MD")&" Days Old!" |
Anyone else familiar with this function? Know about its history or why it's not officially supported?