• tnewquist21.3971755974677437E12
  • NEWBIE
  • 0 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 0
    Replies
The objective of this formula is to calculate the number of days to apply a rebate to based on the billing Period Start Date & Period End Date.

Need help fixing the formula - I am using a text formula field and get error message: - [Syntax error. Extra ',' (Related field: Formula)]  , I am lost on where this extra "," is.  I get a similar error message if I chage formula field type to number formula field.
 
Period_Start_Date__c and Period_End_Date__c. are date format fields 
I am trying to get the formula to check if the period is in Q1 of a leap year so the added day is considered in the final calculation if both criteria are true.
 

text(If(And
 (OR(MOD( YEAR(Period_Start_Date__c), 400 ) = 0, 
  AND(MOD( YEAR(Period_Start_Date__c), 4 ) = 0,
    MOD( YEAR(Period_Start_Date__c), 100 ) != 0)
   ),
      CEILING( MONTH (Period_Start_Date__c) / 3  =  1)),
 
(Period_End_Date__c  - Period_Start_Date__c) + 1)),(Period_End_Date__c  - Period_Start_Date__c ))