I am trying to create a formula field with the below conditions.
Ex: If start date is 1/1/2017 and end date is 5/13/2017. I should get the result as 4.5 If start date is 1/1/2017 and end date is 5/25/2017. I should get the result as 5.0
I created below formula field which is working for the upper date( greater than 15)
IF( DAY(End_Date__c) <= 15, ROUND( ((End_Date__c - Start_Date__c) / 30), 1 ), IF( NOT(ISBLANK(End_Date__c)) && NOT(ISBLANK(Start_Date__c)), ( ((YEAR(End_Date__c) - YEAR(Start_Date__c) - 1) * 12) + (12 - MONTH(Start_Date__c) +1) + MONTH(End_Date__c) ), null ) )
I know that there is an issue my first if condition. The round function is giving result as 4.2 (if date is 8), 4.4 (if date is 12). Can someone suggest me how to fix it.