Question

I am attempting to get the total hours between two times in a SharePoint 2007 list. Right now I have the formula as...

=INT(([Column2]-[Column1])*24)

...which I have looked up and says that it is the correct formula to do this. But, what I get is a weird date like "2/18/1900 12:00 AM" instead of what it should be: 26.

Another formula I tried was...

=TEXT([Column2]-[Column1],"h")

...but, this will only get the difference in hours and not count the days (if they are more than one apart).

Both of the columns are Date & Time columns. So, what am I doing wrong?

Was it helpful?

Solution

My take is that you set the output format of the calculated column to be Date and Time, while it should be of type number.

OTHER TIPS

In a calculated column, the number of hours between two times is:

=TEXT([Column2]-[Column1],"h")

Providing that the difference is less than 24 hours. Otherwise, you'll need to look at getting the days difference and doing a multi-step calculation involving the number of days between the dates * 24 + the calc above.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top