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
Maddie NewstromMaddie Newstrom 

Formula to exclude weekends and choose friday/monday if date falls on weekend.

I am trying to create a date formula off of an existing date field that says if the day lands on a saturday, give me the date for friday and chooses monday if it lands on a sunday. Any ideas on how to do this? I have looked into other weekend formula threads posted and i need the formula to look at my date and say if this date is a weekend AND display the proper date. I would even be happy with if it falls on a weekend add to monday!
I am using this to create follow up tasks and avoid weekend! Thanks!!
 
VinayVinay (Salesforce Developers) 
Hi Maddie,

Check below examples.

https://www.cloudtrailz.com/blog/count-business-days-in-salesforce
https://trailblazers.salesforce.com/answers?id=90630000000gpfIAAQ

Thanks,
Maddie NewstromMaddie Newstrom

Hi Vinay! Thanks for replying - i tried to use the formula you suggested in the second link however i am working in lightening flow. 

I am creating a serires of follow up tasks based on the date the rep would like for them to start - so im starting my first one on that day (which is a weekday) but the follow ups run for anywhere between 9-60 days and I am trying to avoid those landing on the weekends. I am having trouble figuring out how to get the formula to work in flow. I originally built them for my DateToContact + 6, DateToContact + 9 but the days fall on weekends sometimes. Maybe that helps understand the sitation more!