You need to sign in to do that
Don't have an account?
Calculate a date using formula field
Is something like this possible using a formula field? I want to add a numberfield (number of months in 'Estimated_Time_For_Exection__c') to a start date, to calculate the end date.
The formula below gives an error:
Code:
DATE(YEAR(Start_Date__c),MONTH(Start_Date__c)+ Estimated_Time_For_Exection__c ,DAY(Start_Date__c))
FLOOR(((YEAR( Start_Date__c ) * 12) + MONTH ( Start_Date__c ) + Estimated_Time_For_Exection__c) / 12)
-
IF(MOD(MONTH ( Start_Date__c ) + Estimated_Time_For_Exection__c,12) = 0, 1, 0),
IF(MOD(MONTH ( Start_Date__c ) + Estimated_Time_For_Exection__c,12) = 0, 12, MOD((YEAR( Start_Date__c ) * 12) + MONTH ( Start_Date__c ) + Estimated_Time_For_Exection__c,12)),
28
)
All Answers
FLOOR(((YEAR( Start_Date__c ) * 12) + MONTH ( Start_Date__c ) + Estimated_Time_For_Exection__c) / 12)
-
IF(MOD(MONTH ( Start_Date__c ) + Estimated_Time_For_Exection__c,12) = 0, 1, 0),
IF(MOD(MONTH ( Start_Date__c ) + Estimated_Time_For_Exection__c,12) = 0, 12, MOD((YEAR( Start_Date__c ) * 12) + MONTH ( Start_Date__c ) + Estimated_Time_For_Exection__c,12)),
28
)
Hi there,
I would like to see the custom S control. The math I am attempting is slightly easier, I simply want to add 1 year to a date. I'm getting the error about leap years and can't seem to fix it on my own.
Any help would be appreciated.
Thanks,
E
Could you please do one more of these?
I'd basically like the opposite of the first formula you made that added months to a date. I want to subtract months from a date. The good news is the day of the date should always be the 1st, so that part is easy.
My fields are Expiration_Date__c (a date) and Service_Months__c (a number) and Effective_Date__c (the date formula I need help with)
For example:
Exp Date Svc Months Eff Date
1/31/06 12 2/1/05
10/31/07 11 10/1/06
5/31/10 36 6/1/07
1/30/08 1 1/1/08
5/15/09 20 10/1/07
Thank you!!!
i have the same problem that i want to add the month to the start_date ?
can you please provide me the s-control code ? and how can i create it?