I need calculate only workdays for DUE DATE field which uses this existing formula -
IF(
ISNULL(DATEVALUE(DATETIMEVALUE(NewCaseDate__c))),
DATEVALUE(CreatedDate),
DATEVALUE(DATETIMEVALUE(NewCaseDate__c))
) + Days_To_Respond__c"
I have found a formula like this but it throws error
Error: Incorrect parameter type for function 'MOD()'. Expected Number, received Date/Time
Also, formula return type will be DATE and we can't change it.
DATEVALUE(CreatedDate) +
FLOOR(
(Days_To_Respond__c -
IF(
MOD(CreatedDate, 7) = 5,
2,
IF(
MOD(CreatedDate, 7) = 0,
1,
0
)
)
) / 5
) * 7 +
MIN(
Days_To_Respond__c -
IF(
MOD(CreatedDate, 7) = 5,
2,
IF(
MOD(CreatedDate, 7) = 0,
1,
0
)
),
5
)