Forum Discussion

Bernd Kroon's avatar
Bernd Kroon
Brass Contributor
May 27, 2020

How to calculate the duration between two date columns in a List?

Calculation and display of duration of a proces, calculated as difference of two column in SP list

I want to store the difference in days in column C between two columns A and B of a List in Sharepoint.  Both A and B are Date column. Column C is a calculated column. I work in NL, using Netherlands as locale. Field A and B correctly display date/Time in format of Netherlands. The formula in column C (which is A-B) yield a result, the delta in hours is correct, but it shows a date in the 18th century. How can I create the correct number of days?

  • Bernd Kroon You can use the following approach 

    This will be the way column will be defined:

    I hope this gives you some directions to think. Mark the response appropriately if it help you finding the solution.

     

    Thanks,

    Vik

  • Vikram_Samal's avatar
    Vikram_Samal
    Steel Contributor

    Bernd Kroon You can use the following approach 

    This will be the way column will be defined:

    I hope this gives you some directions to think. Mark the response appropriately if it help you finding the solution.

     

    Thanks,

    Vik

    • Mayes1660's avatar
      Mayes1660
      Copper Contributor

      Vikram_Samal Ive used this and it doesnt appear to work quite how i want as it does find the difference eg the dates being 19/07/21 and 23/07/21 and it gives me the result of three however i want it to give me 5 if you get what i mean as this is for holiday requests therefor it needs to count everyday from the first date being the start date and the second being the end date therefor that is how much time off they took? can you help with this?

    • RAVADANEWERA's avatar
      RAVADANEWERA
      Copper Contributor
      I have a similar situation. I have a column that captures a person's started working date (let us say 1st June 2020). I want to create a column to automatically calculate the total experience real time. I added a column with today formula but I want to avoid this and use a formula instead to calculate the total experience with reference to started working date column. Also, would like to see if there is a possibility to get the result in decimals. Your formula was giving the response in intergers.