DateDuration Function

image_pdfimage_print

With this function, you can do two kinds of data calculations:

  1. Calculate the number of hours, days, or other time unit between two different input dates. In this case, input fields are dates of the same date format.
  2. Calculate a new date by adding a given number of hours, days, or other time unit to a given date. In this case, the first input is the start date. The second input is a positive or negative number of units (e.g. days, hours) to be added to the date. The result is the new date in the same format as the start date.

In both cases, two input fields are required. 

Parameters

Sourceformat

Defines the date format of the input field. Example: “dd.MM.yyyy”

Unit

Defines the time unit for the date calculation. Possible values include seconds, minutes, hours, days, weeks, months, and years.
Examples
Input1 Input2 Unit Result
01.01.2012 100 days 10.04.2012
10.04.2012 01.01.2012 days -100
12.04.1967 23.02.2012 years 44
31.01.2012 3 months 30.04.2012
15.10.2012 08:00 15.10.2012 17:00 minutes 540
31.12.1899 40909 days 01.01.2012
31.12.1899 01.01.2012 days 40909

The last two samples can be used for the conversion of a date to a timestamp in Excel.

image_pdfimage_print
Was this post helpful?
NoYes (+1 rating, 1 votes)
Loading...