The Apache OpenOffice spreadsheet program Calc as of the current 4.1.1 version does not provide the
DATEDIF
function found in Microsoft
Office Excel and Google Sheets. The datedif function can be used to calculate the number of days
between two dates in Excel.
Calc does provide a NETWORKDAYS
function, but that gives
you the number of work days between two dates. I.e., weekends are excluded.
NETWORKDAYS
Returns the number of workdays between a start date and an end date. Holidays can be deducted.
Syntax
NETWORKDAYS(StartDate; EndDate; Holidays)
StartDate is the date from when the calculation is carried out. If the start date is a workday, the day is included in the calculation.
EndDate is the date up until when the calculation is carried out. If the end date is a workday, the day is included in the calculation.
Holidays is an optional list of holidays. These are non-working days. Enter a cell range in which the holidays are listed individually.
Example
How many workdays fall between 2001-12-15 and 2002-01-15? The start
date is located in C3 and the end date in D3. Cells F3 to J3 contain the
following Christmas and New Year holidays: "2001-12-24", "2001-12-25",
"2001-12-26", "2001-12-31", "2002-01-01".
=NETWORKDAYS(C3;D3;F3:J3) returns 17 workdays.
However, the DATEDIF function isn't needed to calculate the number of
days between two dates in Calc. Instead, you can simply subtract the two dates.
E.g., if cell B18 contains the date January 1, 2014 and cell B19 contains
the date March 4, 2015, you could place the formula =B19 - B18
in the cell where you want to store the number of days between the two dates.
Unless you change the formatting of the cell to be something other than
a number, you will see 427 as the value in the cell with that formula
given the stated dates. That forumula will produce a result equivalent
to DATEDIF(Start_Date,End_Date,"d")
in Excel.