Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
rajesh26

how to write a formula to exclude weekends and public holidays for the case target completion date ?

Hello All

Can someone help me in calculating the number of days for the target date to be populated excluding weekends and public holidays

For Instance, if the prority is in the case object is high, then the target date should be populated with +2 days from the case created date but should exclude weekends and public holidays.

I wrote the formula for excluding weekend but not able to figure how to add holidays to it. Here is the formula i wrote how to exclude weekends and add +2 days for created date

CASE( MOD( DATEVALUE( [Case].LastModifiedDate ) - DATE( 1900, 1, 7 ), 7 ),
0, [Case].LastModifiedDate + 0 + 1,
4, [Case].LastModifiedDate +  0+ 1,
5, [Case].LastModifiedDate + 2 + 1,
6, [Case].LastModifiedDate + 1 + 1,
[Case].LastModifiedDate + 1
)