[SalesForce] How to subtract months from a date field

How do I create a date formula to show on a report 3 months prior to an account anniversary date. I have been playing around with the below formula but I can not get it to work

IF(MONTH(  Established_Date__c  ) + IF(MONTH( Established_Date__c-((365/12) * 3), IF(YEAR(TODAY())) - (YEAR( Established_Date__c  )), NULL)

Best Answer

If you want to know the days left to the next account anniversary, you can use this formula:

IF (
    DATE(
        YEAR(TODAY()),
        MONTH(Anniversary__c),
        DAY(Anniversary__c)
    ) - TODAY() < 0,
    DATE(
        YEAR(TODAY())+1,
        MONTH(Anniversary__c),
        DAY(Anniversary__c)
    ) - TODAY(),
    DATE(
        YEAR(TODAY()),
        MONTH(Anniversary__c),
        DAY(Anniversary__c)
    ) - TODAY()
)

This will return the days until the next anniversary date. It will display 0 when it comes the day! So in your report you can just filter the accounts using this field, getting every account which has 90 or less days left.