• chakrapani reddy 1
  • NEWBIE
  • 0 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 3
    Replies
send Salesforce reports in excel format to non-salesforce users
and  schedule these reports to be sent form Sandbox


Can you please advice anyone any salesforce appexchange product available 
Hi All,

I'm trying to source a formula that works correctly. I need to display the period between two date fields in Words (Year(s), Month(s), Day(s).
I have found a number of suggessted formulas here and also I have been offered solutions here but they don't seem to work with all date periods. For example, I have a Lease Start Date 01.12.2018 and a Lease End Date 30.11.2021. I was using a formula which was suggested to me in the past but it returns a value of 3 Years, - 1 Month, 29 Days when it should be 2 Years 11 Months 29 Days.
The formula that I have used is below. Maybe it needs some kind of adjustment, I don't really know. 

IF(ISBLANK(End_Date__c),

TEXT(Year(  TODAY()  )- Year(  Start_Date1__c  )) &" "&"Years"&" "&
TEXT(Month(  TODAY()  )-Month(  Start_Date1__c  )) &" "&"Months"&" "&
TEXT(Day(  TODAY()  )-Day(  Start_Date1__c  ))&" "&"Days",

TEXT(Year(  End_Date__c  )- Year(  Start_Date1__c  )) &" "&"Years"&" "&
TEXT(Month(  End_Date__c  )-Month(  Start_Date1__c  )) &" "&"Months"&" "&
TEXT(Day(  End_Date__c  )-Day(  Start_Date1__c  ))&" "&"Days")