I need to build a formula based on the start time, order type and business hours. start time and due time are datetime.

The difficult part about this is I need to calculate this around the business hours. Which means say I need to find the due date 2 days after today, then I need to consider the local business hours whether it will be a weekend and whether there will be a public holiday.

I haven't found related documents around this functionality. Is that doable via formula?

1 Answer 1


If you just want to consider the Weekends then you can do that using formula

Calculate the number of days between two dates while excluding weekends or weekdays.

But there is no standard function available for Holidays. You can upvote this Idea

Access holiday object from formulas and workflow Excluding Holidays Formula

But if you have dates available for public holiday then you can try suggestions from here

Exclude holidays from my formula field that calculates business workdays

But you need to update this formula every year to make it functional. Also it doesn't suitable for long run.

So the best you an do here is use Trigger/Apex to populate the field.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .