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

Date formal to add 15 working days to created date
Hi All,
I have a senariou like this, i have Created Date field(custom field) and Expire Date __c (Formal Datefield). For Example Created date is 6/09/2016 then the Expiredate__c should add 15 working days(30/06/2016) (exclude sunday and saturday) to CreatedDate__C.
My logic for this is :
CASE( MOD( date - DATE( CreatedDate__C ), 7 ),
3, date + 2 + 15,
4, date + 2 + 15,
5, date + 2 + 15,
6, date + 1 + 15,
date + 15
)
But it is not working proparly. Any one please help me to over come this.
Thanks and Regards,
Raji
I have a senariou like this, i have Created Date field(custom field) and Expire Date __c (Formal Datefield). For Example Created date is 6/09/2016 then the Expiredate__c should add 15 working days(30/06/2016) (exclude sunday and saturday) to CreatedDate__C.
My logic for this is :
CASE( MOD( date - DATE( CreatedDate__C ), 7 ),
3, date + 2 + 15,
4, date + 2 + 15,
5, date + 2 + 15,
6, date + 1 + 15,
date + 15
)
But it is not working proparly. Any one please help me to over come this.
Thanks and Regards,
Raji
Note: Jan 05 1970 is Monday, so mod operation will give values from 0-6. 0 for monday, 6 for sunday
If this solves your problem, please mark it as Best Answer.
All Answers
Note: Jan 05 1970 is Monday, so mod operation will give values from 0-6. 0 for monday, 6 for sunday
If this solves your problem, please mark it as Best Answer.
Thanks alot it is working what we expect , can you explain little bit.
Thanks,
Raji
IF(logical_test, value_if_true, value_if_false)
Here logical_test -> MOD (CreatedDate__c - Date(1970,01,05) , 7) <=4
value_if_true -> Date__c+15+6
Value_if_false -> IF(MOD (CreatedDate__c - Date(1970,01,05) , 7) = 5, Date__c+15+5,Date__c+15+4 )
Instead of stating a value for value_if_false part, an IF statement has been used to acheive functionality of nested IF.
The first MOD (CreatedDate__c - Date(1970,01,05) , 7) <=4 checks whether Day of Created Date__c is from monday to friday,
if this evaluates to true then formula returns CteatedDate__c +15 working days + 6 days (for 3 weekends)
if this evalautes to false
then two cases arise, either the Day of CreatedDate__c is saturday or sundays
The second MOD (CreatedDate__c - Date(1970,01,05) , 7) =5 checks whether the Day is Saturday
if it evaluates to true then formula returns CteatedDate__c +15 working days + 5 days (next sunday and two more weekends)
else it returns CteatedDate__c +15 working days + 4 days (next two weekends)
Hope it helps.
I just used this formula and it worked perfectly for me!!! Thank you!! I need a second field that then caculates this date minus - 2 working days!
Can you please help me with this formula? You need to be mindful that the working week here in Dubai is Sun-Fri
Many thanks
This thread is marked SOLVED.
please start a new thread by asking a question and people will help you.