XL: Undocumented Worksheet Function DATEDIFLast reviewed: February 2, 1998Article ID: Q129277 |
The information in this article applies to:
SUMMARYIn Microsoft Excel, there is an undocumented worksheet function, DATEDIF, which calculates the difference between two dates in days, months, or years. The following information describes this function, its parameters, and how to obtain the same information using documented functions in Microsoft Excel. For information about using documented functions instead of the DATEDIF function to calculate the difference between two dates, in days, months, or years, please see the following articles in the Microsoft Knowledge Base:
ARTICLE-ID: Q67093 TITLE : How to Calculate the Number of Months Between Two Given Dates ARTICLE-ID: Q27089 TITLE : XL: Calculating the Number of Days Between Two Dates ARTICLE-ID: Q81694 TITLE : XL: Formula to Calculate Number of Days in Month MORE INFORMATIONThe DATEDIF function uses the following parameters:
DATEDIF(start_date,end_date,units_text)NOTES: start_date: The starting date of the period that you are calculating. end_date: The ending date of the period that you are calculating. (If you are calculating an age to today's date, you can use the TODAY function for the end_date argument.) units_text: Specifies units to measure the difference in:
"Y" returns the number of full years in the period "M" returns the number of full months in the period "D" returns the number of full days in the period "md" returns the number of full days in excess of the last full month "ym" returns the number of full months in excess of the last full year "yd" returns the number of full days in excess of the last full yearIn the following example
A1: 11/11/69 A2: 04/05/95 A3: =DATEDIF(A1,A2,"Y")cell A3 returns the value 25 for 25 full years difference between the date in cell A1, and the date in cell A2. Note that the DATEDIF function is also available in Lotus 1-2-3.
|
Additional query words: 5.00 5.00a 5.00c 7.00 8.00 97 XL97 98 XL98
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |