The result from DATEDIF is a number that corresponds to the time unit requested.
The status of DATEDIF in Excel is somewhat mysterious.
The desired interval is specified with theunitargument, which is supplied as text.
The table below shows the available unit values and the results for each.
Time units can be provided in upper or lower case (i.e.
“ym” is equivalent to “YM”).
This means DATEDIF will round months down even when it is very close to the next whole month.
For a detailed explanation of calculating months between dates with several alternative formulas,see this example.
Because DATEDIF only calculates complete years, the result is still 5.
In row 7 we use theYEARFRAC functionto calculate a more accurate result.
Download the workbook and read a complete explanationon this page.
you might find a full explanation and download the workbookon this page.
NETWORKDAYS automatically excludes weekends (Saturday and Sunday) and canoptionallyexclude a list of holidays supplied as dates.
For example, the formula =DAYS360(“1-Jan-2021”,“31-Dec-2021”) returns 360 days.