I have two dates,
Created date and date processed.
I want to find the midway between these two days but make sure the midway date lands on a business day.
DATEVALUE(createdDate) + (( Date_processed__c - DATEVALUE(CreatedDate)) / 2)
This returns a date value between these two dates but does not consider if it lands on a business day. How can I do that or is it not possible in a formula field?
Best Answer
If your business days are more complex than just a weekend/weekday split, you'll need to do this in a trigger or a batch job. Formulas do not have access to the "Business Days" as configured in salesforce. Theres a decade old idea for support, so I wouldn't expect it anytime soon.
These are the formulas salesforce provides as examples for determining Weekend/Weekday values, excluding one or the other.
Weekday Count Formula:
Weekend Days Count Formula:
Heres a sample of that same formula, written in apex. You'll need either a trigger or a batch job to run it.