Skip to main content
Hi Guys.

 

I am trying to write a formula to accomandate when a leap year is going to be. Basically our opportunity renewals renew within 12 months from the original opps creation date.

 

I have written the below. And although it does work for the months. It does not seem to count the leap years ive tried to enter in the division part so it thinks every year is a leap year no matter what.

 

IF ( OR(AND((MONTH(   {!CurrentOpportunityCloseDate}) = 1), NOT(OR( 

 

MOD( YEAR(  {!CurrentOpportunityCloseDate} ), 400 ) = 0, 

 

AND( 

 

MOD( YEAR(  {!CurrentOpportunityCloseDate} ), 4 ) = 0,

 

MOD( YEAR(  {!CurrentOpportunityCloseDate}), 100 ) != 0

 

))

 

)), AND((MONTH(   {!CurrentOpportunityCloseDate}) = 2), NOT(OR( 

 

MOD( YEAR(  {!CurrentOpportunityCloseDate} ), 400 ) = 0, 

 

AND( 

 

MOD( YEAR(  {!CurrentOpportunityCloseDate} ), 4 ) = 0,

 

MOD( YEAR(  {!CurrentOpportunityCloseDate} ), 100 ) != 0

 

))

 

))),  {!CurrentOpportunityCloseDate}+365,  {!CurrentOpportunityCloseDate}+364)

 

Any help is very mucha appreciated.

 

 
2 Antworten
  1. 9. Apr. 2019, 15:31
    Hi Paul,

     

    I would just use the ADDMONTHS Function

     

    please give this a shot

    ADDMONTHS({!CurrentOpportunityCloseDate},12)

    the above formula will add 12 months to the opportunity close date

     

     
0/9000