If(if ( End_Date__c < DATE(2011,12,31), End_Date__c , datevalue("2011-12-31")) - if ( Start_Date__c > Date (2011, 12, 1), Start_Date__c, datevalue("2011-12-1"))<0,0,if ( End_Date__c < DATE(2011,12,31), End_Date__c , datevalue("2011-12-31")) - if ( Start_Date__c > Date (2011, 12, 1), Start_Date__c, datevalue("2011-12-1")-1))
The outcome of this formula is a number between 0 and 31. This particular formula is for the month of Dec, 2011. Then I use the same formula for each of the months.
Thanks for helping
2 respuestas
We have contracts that start and end on different days of the months.
We calculate commission based on number of days that the contract is still active
Therefore for each contracts we need to determiine how many active days are there for each of the months.
The formula does this for each month by changing the last date of each month in the formula.