You need to sign in to do that
Don't have an account?
Priyanka85
Formula Field
Create a formula field that calculates the Age in hours of the case that is displayed on the case page layout. The age of the case is defined as the difference in hours between the Date/Time opened and date/time closed for the case. If the case is still open, the age should calculate the difference between case creation and the current date/time. If the case is closed, the age should calculate the difference between the case closed date/time and the case created date/time.
For eg: 1.5 hours if the case has been opened for an hour and a half.
Any suggestions???
IF( ClosedDate!=null, (ClosedDate - CreatedDate)*24 ,(DATETIMEVALUE(Today())-CreatedDate)*24)
All Answers
if( isNULL(CloseDate), (Now() - CreatedDate)*24, (Now() - CloseDate)*24)
You may have to change the field names to fit your org, but the idea is there. Let me know if you have any questions.
IF( ClosedDate!=null, (ClosedDate - CreatedDate)*24 ,(DATETIMEVALUE(Today())-CreatedDate)*24)
I have made Number type formula field with decimal value =1 and formula is
IF( IsClosed, (ClosedDate - CreatedDate)*24, (NOW() - CreatedDate)*24 )
but its not working.
give decimal value =2 .It is working for me
Screen of mine
I want to calculate the age in hours.. so i multipiled it with 24 but then it is showing some wired data..
Refer below screen
did u apply my formula.You applying some different formula
Jus copy paste it .U will get it
IF( ClosedDate!=null, ClosedDate - CreatedDate ,DATETIMEVALUE(Today())-CreatedDate)
As per your formula, output is:
first try by giving both dates.
Else try this
IF( ClosedDate!=null, ClosedDate - CreatedDate ,ABS(DATETIMEVALUE(Today())-CreatedDate))
tried :(
IF( ClosedDate!=null, ClosedDate - CreatedDate ,ABS(DATETIMEVALUE(Today())-CreatedDate))
for eg: age= 1.5 hours if the case has been opened for an hour and a half.
Age should be 3.5hours... that is what i want
but it is showing 0.79