• Alison LaRocco 9
  • NEWBIE
  • 10 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies
Hi There!

I am trying to calculate the total number os days in a given month based on custom fields created at the Opportunity level:

Custom Fields:
  • Start Date
  • End Date
  • Start Month
  • Last Day EOM
IF( Start_Date__c > Last_Day_EOM__c ,0,
IF( End_Date__c < Start_Month__c ,0,
IF(AND(Start_Date__c < Start_Month__c ,End_Date__c > Last_Day_EOM__c), Last_Day_EOM__c - Start_Month__c +1,
IF(AND(Start_Date__c < Start_Month__c, End_Date__c <= Last_Day_EOM__c), End_Date__c - Start_Month__c +1,
IF(AND(Start_Date__c >=Start_Month__c, End_Date__c <= Last_Day_EOM__c), End_Date__c - Start_Date__c +1,
IF(AND(Start_Date__c >= Start_Month__c,End_Date__c > Last_Day_EOM__c), Start_Month__c - Start_Date__c +1 , 0 ))))))

Any assistance in shorting this formula would be GREAT!

Thanks all!
Hi There!

I am trying to calculate the total number os days in a given month based on custom fields created at the Opportunity level:

Custom Fields:
  • Start Date
  • End Date
  • Start Month
  • Last Day EOM
IF( Start_Date__c > Last_Day_EOM__c ,0,
IF( End_Date__c < Start_Month__c ,0,
IF(AND(Start_Date__c < Start_Month__c ,End_Date__c > Last_Day_EOM__c), Last_Day_EOM__c - Start_Month__c +1,
IF(AND(Start_Date__c < Start_Month__c, End_Date__c <= Last_Day_EOM__c), End_Date__c - Start_Month__c +1,
IF(AND(Start_Date__c >=Start_Month__c, End_Date__c <= Last_Day_EOM__c), End_Date__c - Start_Date__c +1,
IF(AND(Start_Date__c >= Start_Month__c,End_Date__c > Last_Day_EOM__c), Start_Month__c - Start_Date__c +1 , 0 ))))))

Any assistance in shorting this formula would be GREAT!

Thanks all!