DATEDIF /text/scalc/01/func_datedif.xhp DATEDIF function date difference DATEDIF Returns the difference between two date values, in the units specified. Syntax DATEDIF(StartDate; EndDate; Format) StartDate is the start date of the interval. EndDate is the end date of the interval. Time fractions are ignored. Format is a text value that specifies the unit of the result. Upper and lower case letters are equivalent. Format Meaning "d" Number of days between the dates. "m" Number of complete calendar months between the dates. "y" Number of complete calendar years between the dates. "md" Days, ignoring months and years. As in Microsoft Excel, the days of the month before the month of EndDate are borrowed, so the result can be negative: from January 31 to March 1, 2024 it is -1. "ym" Months, ignoring years. "yd" Days, ignoring years. As in Microsoft Excel, EndDate is moved into the year of StartDate, or into the next year if it would come before StartDate.
If StartDate is later than EndDate, the result is an error. Examples =DATEDIF("2024-01-01";"2024-12-31";"d") returns 365. =DATEDIF("2024-01-01";"2025-01-01";"y") returns 1.