Trying to calculate hours between two dates on a SharePoint List

%3CLINGO-SUB%20id%3D%22lingo-sub-2002050%22%20slang%3D%22en-US%22%3ETrying%20to%20calculate%20hours%20between%20two%20dates%20on%20a%20SharePoint%20List%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2002050%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20Guys%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20am%20trying%20to%20calculate%20hours%20between%20created%20and%20modified%20date%2C%20I%20have%20tried%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3DTEXT(Modified-Created%2C%22h%22)%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ebut%20it%20doesn't%20work.%20I%20have%20read%20that%20it%20only%20really%20works%20if%20it%20is%20within%2024%20hours.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EJ%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2002050%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3ELists%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESharePoint%20Online%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2003541%22%20slang%3D%22en-US%22%3ERe%3A%20Trying%20to%20calculate%20hours%20between%20two%20dates%20on%20a%20SharePoint%20List%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2003541%22%20slang%3D%22en-US%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F896720%22%20target%3D%22_blank%22%3E%40Jbrines1969%3C%2FA%3E%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHere%20is%20a%20formula%2C%20which%20will%20calculate%20hour%20difference%20between%20two%20dates.%3C%2FP%3E%3CP%3E%3DINT(Modified-Created)*24%2BHOUR(Modified-Created)%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2006817%22%20slang%3D%22en-US%22%3ERe%3A%20Trying%20to%20calculate%20hours%20between%20two%20dates%20on%20a%20SharePoint%20List%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2006817%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F5628%22%20target%3D%22_blank%22%3E%40Matti%20Paukkonen%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIs%20it%20possible%20to%20get%20the%20hours%20between%20a%20modified%20date%20and%20Now%20or%20Today%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Contributor

Hi Guys,

 

I am trying to calculate hours between created and modified date, I have tried

 

=TEXT(Modified-Created,"h")

 

but it doesn't work. I have read that it only really works if it is within 24 hours.

 

J

4 Replies

Hi @Jbrines1969,

 

Here is a formula, which will calculate hour difference between two dates.

=INT(Modified-Created)*24+HOUR(Modified-Created) 

@Matti Paukkonen 

 

Is it possible to get the hours between a modified date and Now or Today?

@Jbrines1969 

 

That is not going to work, because calculated field values are only updated when list items is modified.

@Matti Paukkonen 

 

So this calculation to get Days Old isn't really showing a true calculation?

 

=IF(LEN([Date Assigned to Sub])=0,0,DATEDIF([Date Assigned to Sub],TODAY(),"d"))

 

If it is then is there any way of changing it calculate hours.

 

This was created when I created the SharePoint list by the system