I Want to display a value using formula field such it is a time ahead of created date and Recordactive text field based on status field values to Totaldays text field.

If Status=active means Today()-(record created date - Recordactive)

here today()=6/10/2017, created date= 5/10/2017, Recordactive=25

now using date values: 6-(5-25)=-14

finally how can i show Total days value -14 to 14 in Totaldays text field using formula field?


Something like this?

IF(ISPICKVAL(Status__c, 'Active'),
    TEXT(ABS(TODAY() - (DATEVALUE(CreatedDate) - RecordActive__c))),

Finally ABS is absolute value (ignoring the sign).

More info:

| improve this answer | |
  • But, Based on my Question How to show Totalvalue 14 using formula field – Sfdcprgmr Oct 6 '17 at 10:25
  • ABS should leave you with a number and then TEXT would be a safe way to convert it to text value (if your formula is really a text type, not numeric). Does it throw you any errors when compiling the formula? – eyescream Oct 6 '17 at 10:27
  • As stupid as it is, such formula saves OK for me on Account: IF(Phone = '', TEXT(ABS(TODAY() - (DATEVALUE(CreatedDate) - 25))), '' ) – eyescream Oct 6 '17 at 10:33
  • The formula field looks like not working. Its giving different value which is equal to Recordactive. But, it should return 14. – KS Kumaar Oct 6 '17 at 12:05
  • @eyescream are you getting the exact answer? – KS Kumaar Oct 6 '17 at 14:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.