You need to sign in to do that
Don't have an account?

Subscription Months+days
Hi
I need to calulate the time between two dates (start date and end date) so far Its calculating months alone but I need to calculate months+days menaing if start date =7/18/2016 and end date = 7/18/2017 its 12months which is good but
if start date =7/18/2016 end date = 7/19/2017 it should actually be 12.01(12months ,1 day)
the formula that I am using is :
IF(NOT(ISBLANK(EndDate__c)) &&
NOT(ISBLANK(StartDate__c))
,(((YEAR(EndDate__c) - YEAR(StartDate__c) - 1) *12) + (12 - MONTH(StartDate__c) +1) + MONTH(EndDate__c)
- 1+ IF(DAY(EndDate__c) > DAY(StartDate__c),1,0)),
null
)
Please help
I need to calulate the time between two dates (start date and end date) so far Its calculating months alone but I need to calculate months+days menaing if start date =7/18/2016 and end date = 7/18/2017 its 12months which is good but
if start date =7/18/2016 end date = 7/19/2017 it should actually be 12.01(12months ,1 day)
the formula that I am using is :
IF(NOT(ISBLANK(EndDate__c)) &&
NOT(ISBLANK(StartDate__c))
,(((YEAR(EndDate__c) - YEAR(StartDate__c) - 1) *12) + (12 - MONTH(StartDate__c) +1) + MONTH(EndDate__c)
- 1+ IF(DAY(EndDate__c) > DAY(StartDate__c),1,0)),
null
)
Please help
Anyways use the below one Check for any missing brackets.
Assuming your start and end date are of type Date
All Answers
Can you please try below formula
Return type of the formula is TEXT
I changed my return type to Text and copy pasted the formula you gave the result it gave me is 0,1
my startdate =7/18/2016
end date=7/18/2017, in fact irrespective of any dates its giving output as 0,1
Anyways use the below one Check for any missing brackets.
Assuming your start and end date are of type Date
I edited the date fields as per my requirement and added a missing bracket .Yes,my start and end date fields are of type date
and my return type for the formula is 'Text'
IF(NOT(ISBLANK(Start_Date__c)) &&
NOT(ISBLANK(End_Date__c))
, TEXT(((YEAR(End_Date__c) - YEAR(Start_Date__c) - 1) *12) + (12 - MONTH(Start_Date__c) +1) + MONTH(End_Date__c)
- 1)+','+TEXT(IF(DAY(Start_Date__c) > DAY(End_Date__c), DAY(Start_Date__c) - DAY(End_Date__c), DAY(End_Date__c) - DAY(Start_Date__c))),
null
)
I even market the answer as best answer in my earlier reply ,I don't know wht that did not get captured
Sorry for troubling you this many times.But ,you are the only goto person for me
I gave start date = 1/1/2015
end date = 12/31/2015
the answer it gave me is 11.30 but it shd actually be 12 months as it a full one year starting from Jan1st to Dec 31st.
So, for start date = 1/1/2015, end date = 12/31/2015 : it will 11 months and 30 days.
Correct me if I'm wrong.
if start date = 1/1/2015
end date = 12/31/2015