SOLVED

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

Brass Contributor

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?

7 Replies
best response confirmed by Bernd Kroon (Brass Contributor)
Solution

@Bernd Kroon You can use the following approach 

Vikram_Samal_0-1590610121059.png

This will be the way column will be defined:

Vikram_Samal_1-1590610219403.png

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

 

Thanks,

Vik

@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?

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.

Hi Sir,  I want to calculate the date, but the Delta is decreased on according to dates coming to target dates @Vikram_Samal 

@Mayes1660 you simply need to add 2 to the formula. It is always going to be a difference of 2.

@Vikram_Samal 

 

I did this using UK time/dates

Start 22/1/2024 19:00 and end 22/1/2024 20:10

The delta is shown as "30" using your formula. I would like to calculate hours and tried swapping the "D" to both "h" and "H" and it says "#VALUE!"

I tried it as number and single line of text but still no avail

 

Can you help

1 best response

Accepted Solutions
best response confirmed by Bernd Kroon (Brass Contributor)
Solution

@Bernd Kroon You can use the following approach 

Vikram_Samal_0-1590610121059.png

This will be the way column will be defined:

Vikram_Samal_1-1590610219403.png

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

 

Thanks,

Vik

View solution in original post