Domanda

I'm trying to calculate the duration between when an item is created and the last time it was modified. I'm not sure what's wrong with my formula though because the equation is saying there are 41XXX days when it should be 3. This doesn't happen for all items though, only certain ones.

=IF(DATEDIF(Created,Modified,"d")>1,DATEDIF(Created,Modified,"d")&" days ",DATEDIF(Created,Modified,"d")&" day ")&TEXT(Modified-Created,"hh:mm:ss")

enter image description here

È stato utile?

Soluzione

SharePoint seems confused as it is displaying the numerical (integer) representation of 8/18/2013 (US) which is 41504. Your formula displays a result directly in Excel, although the days difference is 2, not the 3 that it displays.

You might simplify it with:

=TEXT(Modified-Created,"d ""day(s)"" hh:mm:ss")

which in Excel displays

2 day(s) 17:34:00

I am not able to test it from SharePoint though.

I suppose if you really want to display either day or days then you might try:

=TEXT(Modified-Created,"d ""day"""&IF(VALUE(TEXT(Modified-Created,"d"))>1,"""s""","")&" hh:mm:ss")

This could possibly be simplified (if SP can cope) to:

=TEXT(Modified-Created,"d ""day"""&IF(Modified-Created>1,"""s""","")&" hh:mm:ss")
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top