Skip to content

=DATEDIFF

The DATEDIFF function calculates the difference between two dates and returns the result in the specified unit of time.

=DATEDIFF(ReturnUnit; SubtractThisDate; FromThisDate)
  • 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.
  • Subtracts SubtractThisDate from FromThisDate.

  • Converts the difference into the unit specified in ReturnUnit.

  • Returns a numeric value representing the time difference.

  • 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.

=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 1468800

DATEDIFF, date difference, time difference, date calculation, numeric result, date subtraction, workflow formulas, formula function, time units