1

I am creating some scheduling of dates for a task in SharePoint Online. The user enters the first date and a number of days it will take to complete the work. I have created a calculated column which subtracts the number of days from the Finish Date and populates the date to start, such as =[Finish Date]-[No of Days]

However I want it to calculate only weekdays. This is the equation I've created, but I can't get it to work. Any ideas?

=IF(WEEKDAY([Finish Date]-[No of Days])=1,([Finish Date]-[No of Days])-2, IF(WEEKDAY([Finish Date]-[No of Days])=7,([Finish Date]-[No of Days])-1,([Finish Date]-[No of Days])))

2 Answers 2

1

Try this formula

=IF(WEEKDAY([Finish Date]-(FLOOR([No of Days]/5,1)*7+MOD([No of Days],5)-1))=1,[Finish Date]-(FLOOR([No of Days]/5,1)*7+MOD([No of Days],5)-1)-2,IF(WEEKDAY([Finish Date]-(FLOOR([No of Days]/5,1)*7+MOD([No of Days],5)-1))=7,[Finish Date]-(FLOOR([No of Days]/5,1)*7+MOD([No of Days],5)-1)-1,[Finish Date]-(FLOOR([No of Days]/5,1)*7+MOD([No of Days],5)-1)))
1
  • works for me! Thanks
    – Tally
    Commented Mar 12, 2019 at 15:31
0

This formula adds two days to a start date column but looks to whether the start date falls on either a Thursday (5th day) or Friday (6th day) to add 2 or 1 days respectively.

=([Start Date])+2+IF(OR(WEEKDAY([Start Date])=5,WEEKDAY([Start Date])=6),2,0)+IF(WEEKDAY([Start Date])=7,1,0)
1
  • As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.
    – Community Bot
    Commented May 25, 2023 at 16:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.