
Hi all,
I have this formula that works great for adding business days (got it from these forums). I have tried messing around with the formula to get it to work backwards to no avail.
An example scenario would be
A user inputs a due date and I create several previous dates by subtracting 3 days (including the current day and excluding weekends) from each as follows
6/23/21 Final Due Date (User entered)
6/21/21 Stage 3 Due Date (-3 days from final due date)
6/17/21 Stage 2 Due Date (-3 days from stage 3 due date)
6/15/21 Stage 1 Due Date (-3 days from stage 2 due date)
Here is the code:
DateAdd(
DateValue("6/23/2021"),
Value(3) - 1 + RoundDown(
((Weekday(
DateValue("6/23/2021"),
Monday
) + Value(3) - 1) - 1) / 5,
0
) * 2,
Days
)
// Equals 6/25/2021 but I want it to equal 6/21/2021
I am trying to get better with dates but struggling with this.
Any help would be appreciated.
Thanks