1

I have list with two date fields. It is also containing time information. It is based on leave request so I need to calculate hour basis for half a day leave.

If user enters 8/1/2016 08:00 AM as start date and 8/1/2016 12:30 PM as end date then I need to show 0.5 days.

If user enters 8/1/2016 08:00 AM as start date and 9/1/2016 12:30 PM as end date then I need to show 1.5 days.

1
  • Base will be =DATEDIF([Column1], [Column2],"d") and you may have to play on the display to shoy the hour differences.
    – Seb
    Commented Jan 8, 2016 at 13:30

1 Answer 1

1

Here is a modified calculation that I have used before and believe it will benefit you as well.

=DATEDIF([Start Date],[End Date]-(MOD([Start Date],1)>MOD([End Date],1)),"d")&" days, "&TEXT(MOD([End Date]-[Start Date],1),"hh "" hrs, "" mm "" mins""")

For example: If a user enters 8/1/2016 8:00 AM as start date and 8/10/2016 12:30 PM as end date, your Output would look like this: 9 days, 4 hrs, 30 mins

Though you can format to better fit your situation.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.