DATEDIF {ExcelFunctionsR} | R Documentation |
Basic DATEDIF function from excel
Description
It acts similiarly to Excel's DATEDIF function. It returns difference between two dates, either day,month or year, it's up to the user to specify which type of difference user wants.
Usage
DATEDIF(start_date, end_date, difference = "d")
Arguments
start_date |
Start date to evaluate the difference |
end_date |
End Date to evaluate the difference |
difference |
What type of difference do you want? Year,Month or Day? Specify "m" for example for month/months, "d" for day/days and "y" for year/years. |
Value
In these examples we have all 3 types of returns, first is difference between specified two dates in days, second one is difference in months and third one is difference in years.Function will always return numeric class.
Examples
DATEDIF(DATE(2020,1,1),DATE(2020,2,1),"d")
DATEDIF(DATE(2020,1,1),DATE(2020,2,1),"m")
DATEDIF(DATE(2020,1,1),DATE(2020,2,1),"Y")
[Package ExcelFunctionsR version 0.1.4 Index]