function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Myriam ZaidiMyriam Zaidi 

Formula For Time Intervals

I am currently trying to create a formula that will include a time interval, meaning I want to identify the accounts that have been active between 2 and 5 years from today. Is that possible? If so, how? (i.e. for the time between today and two years ago, it'd be TODAY()+730, but how do I set it for TODAY()+730 until TODAY()+1825?)
RaidanRaidan
Hi Myriam,

If you create a formula that returns a checkbox, and assuming your date field is called Date__c, then you can write it like this:
AND(Date__c >= TODAY()+730, Date__c <= TODAY()+1825)

 
Deepak RathinaveluDeepak Rathinavelu
Hi Raidan, Myriam

If the accounts were active the date must be in past why are we adding days here,

instead
 
AND(Date__c <= TODAY()-730, Date__c >= TODAY()-1825)
I am assuming 730 and 1825 are days here.

Regards,
Deepak Rathinavelu