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
Kim BaileyKim Bailey 

I need a formula to give me a True/False for a checkbox field, if a DATE falls in the last 13 months.

Can't find anything this simple anywhere and need HELP please!!! We use this constantly to check if an account purchased a certain product in the last 13 months for specials, offers, etc. 
Keval PadiaKeval Padia
Hey Kim, please find below mentioned details and screenshots that may help you achieve your objective.

I have created 3 Custom Fields on Account Object that suits your requirement.
  • Last Purchase Date (Date/Time field type)
  • Eligible for Special Offers (Formula (Checkbox))
  • 13 Months from Created Date (Formule (Date/Time))
In "Last Purchase Date" field, you will have to provide the date at which your customer last bought from you.

I have created "13 Months from Created Date" field as 13 Month reference for Last Purchase Date field and Eligible for Special Offers. This field will return date/time which is 13 Months from the Created Date (As example I have used Created Date field, but you can use another Date field) as a reference which we are going to use in "Eligible for Special Offers" Formula(Checkbox field). The formula that I have used in "13 Months from Created Date" field is as below
  • ADDMONTHS( CreatedDate ,13)
The "Eligible for Special Offers" field will calculate the difference between "Last Purchase Date" and "13 Months from Created Date" and if the difference is less or equal to 13 Months, then "Eligible for Special Offers" checkbox will be checked (TRUE). If the difference is greater than 13, then "Eligible for Special Offers" checkbox will be left unchecked (False). The formula that I have used in "Eligible for Special Offers" formula (checkbox) field is as below
  • IF(Last_Purchase_Date__c <= X13_Months_from_Created_Date__c , TRUE, FALSE)
Scenario 1: Where Last Purchase Date <= 13 Months from Created Date
User-added image
Scenario 2: Where Last Purchase Date > 13 Months from Created Date
User-added image

Hope this answer helps you. Also, if you need assistance related to any SFDC Customization and Development, do let me know. For more reference, do visit my company's website and profile which is given below in the signature.

Regards,
Keval Padia,
www.nimblechapps.com
https://sforce.co/2SFCx85
Michelle Yan 17Michelle Yan 17
to check for purchase in the last 13 months, you should go backwards from today.  

ADDMONTHS(Today, -13)

Follow steps as listed above after that.