function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Mahboob AljiwalaMahboob Aljiwala 

How can i exclude holidays on my custom formula field using custom holiday object ?

Khan AnasKhan Anas (Salesforce Developers) 
Hi Mahboob,

Greetings to you!

Please refer to below link which might help you.

https://success.salesforce.com/answers?id=9063A0000019QHUQA2

It is an idea (https://success.salesforce.com/ideaView?id=08730000000I75dAAC) to exclude both holidays and weekends in Formula.

If you want to calculate the number of days between two dates while excluding weekends or weekdays, you can refer to below knowledge article.

https://help.salesforce.com/articleView?id=000004526&type=1

However, you can use this Apex code to exclude holidays and weekends in Formula.

https://sfdcdev.wordpress.com/2011/09/24/handling-holidays-in-salesforce-apex/

I hope it helps you.

Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future.

Thanks and Regards,
Khan Anas