Learn how you can use the DATEDIF SharePoint function to calculate the difference between two dates in a SharePoint list or library.
Document Management almost always involve working with dates, such as start dates, end dates, due dates, etc.
And often, you might want to perform date calculations, for example, to find out how many days are left before a due date arrives, that is, calculate the difference between two dates.
You can create a calculated column in SharePoint to calculate date differences or use any other function from a list of available SharePoint functions to perform other types of calculations in SharePoint.
To add a column to a SharePoint list or library to calculate the difference between two dates:
and then double-click Start Date in the Insert Column list box to add the start date field to the formula. Click in the Formula text box at the end of the formula and type:
and then double-click Due Date in the Insert Column list box to add the due date field to the formula. Click in the Formula text box at the end of the formula and type:
The completed formula should look something like:
=DATEDIF([Start Date],[Due Date],"D")
You can read more about using the DATEDIF SharePoint function on Office Online.
Now whenever you create a new task in the SharePoint Tasks list and fill out the start date and due date, the difference between the two dates is calculated. The result of this date difference calculation can be used in SharePoint Designer workflows.