=DATEDIFF
The DATEDIFF function calculates the difference between two dates and returns the result in the specified unit of time.
Syntax
Section titled “Syntax”=DATEDIFF(ReturnUnit; SubtractThisDate; FromThisDate)Parameters
Section titled “Parameters”-
ReturnUnit
- The unit in which to return the difference. The options to use are: second, minute, hour, workhour, day, weekday.
-
SubtractThisDate
- The starting date or the date to subtract from the second date.
-
FromThisDate
- The ending date or the date from which the first date is subtracted.
How It Works
Section titled “How It Works”-
Subtracts SubtractThisDate from FromThisDate.
-
Converts the difference into the unit specified in ReturnUnit.
-
Returns a numeric value representing the time difference.
Usage Notes
Section titled “Usage Notes”-
Ensure dates are in a valid format.
-
Units like workhour or weekday only consider business hours or weekdays.
-
Formula functions are case sensitive and must be in all caps.
-
Can be used for calculations, reporting, or workflow conditions.
Examples
Section titled “Examples”=DATEDIFF(day; 2023-03-04; 2023-03-21) Returns 17=DATEDIFF(hour; 2023-03-04; 2023-03-21) Returns 408=DATEDIFF(minute; 2023-03-04; 2023-03-21) Returns 24480=DATEDIFF(second; 2023-03-04; 2023-03-21) Returns 1468800Keywords
Section titled “Keywords”DATEDIFF, date difference, time difference, date calculation, numeric result, date subtraction, workflow formulas, formula function, time units