Sorry, but the calculation is incorrect. E.g., Friday to Monday (inclusively) is two days, not three, and Monday to Monday (inclusively) is 6 days, not 5.
Fixed the calculation, and changed/split the formula to hopefully be a bit clearer. First I determine the number of weekends that must be jumped over:
RoundDown((thisRow.[Duration (in business days)] + thisRow.[Start Date].Weekday() - 3) / 5)
- Number of weekends = how many full times duration is strictly larger than 5. Hence (duration - 1) / 5…
- …but that would be true if we counted since Monday. So account for the fact that StartDay may land on another work day by adding
StartDate.Weekday() - 2 (because Monday is 2)
Then I add that to the input number, and subtract 1 because we’re counting days inclusively.
Full formula would be:
thisRow.[Start Date] + Days(
thisRow.[Duration (in business days)]
+ RoundDown((thisRow.[Duration (in business days)] + thisRow.[Start Date].Weekday() - 3) / 5) * 2
It will break if start date is not in Mon-Fri range though. But handling invalid input is left for the reader as an exercise