I'd like to created a calculated column which subtracts the modified date/time from the creation date/time, is this possible?
EDIT: This worked for me - =TEXT(B2-A2,"h:mm:ss") replace the cell references with your actual columns.
I'd like to created a calculated column which subtracts the modified date/time from the creation date/time, is this possible?
EDIT: This worked for me - =TEXT(B2-A2,"h:mm:ss") replace the cell references with your actual columns.
=DATEDIF(Created,Modified,"d")&" days "&TEXT(Modified-Created,"hh:mm:ss")
This seems to be a slightly easier way to achieve it. You could obviously tweak the second part to break out the hours, minutes and seconds if required.
The functions available in calculated columns are available here http://msdn.microsoft.com/en-us/library/bb862071%28v=office.14%29.aspx
One example over here shows Date Difference in days – Hours – Min format : e.g 4days 5hours 10min :
=YEAR(Today)-YEAR(Created)-IF(OR(MONTH(Today)<MONTH(Created),AND(MONTH(Today)=MONTH(Created),
DAY(Today)<DAY(Created))),1,0)&” years, “&MONTH(Today)-MONTH(Created)+IF(AND(MONTH(Today)
< =MONTH(Created),DAY(Today)<DAY(Created)),11,IF(AND(MONTH(Today)<MONTH(Created),DAY(Today)
> =DAY(Created)),12,IF(AND(MONTH(Today)>MONTH(Created),DAY(Today)<DAY(Created)),-1)))&” months,
“&Today-DATE(YEAR(Today),MONTH(Today)-IF(DAY(Today)<DAY(Created),1,0),DAY(Created))&” days”
This can help you accomplish your task.