# How to Subtract Workdays

Hello Everyone, I am trying to subtract a calculated about of days from a date to give me a required start date. I know i can do this with the subtract days function but I need to to only subtract work days.

This is what i have tried:
FORMAT_DATE(WEEKDAYS({Rough-In Date},-1*({SD Creation Days}+{SD Review Days}+{SD Edit Days}+{AE Review Days}+{Fabrication Days})))

FORMAT_DATE(WORKDAY({Rough-In Date},-1*({SD Creation Days}+{SD Review Days}+{SD Edit Days}+{AE Review Days}+{Fabrication Days})))

I can add work days but it wont let me subtract. Any Ideas?

Hey @zrodgers! Would you be happy to share a screenshot of the columns you have set up? Additionally, how are you currently calculating the the amount of days to subtract? This will just help with our testing I found a solution

``````IF(AND(GTE({Sum Review Time},0),INT({Sum Review Time})={Sum Review Time},{Rough-In Date}) ,FORMAT_DATE(
SWITCH({Sum Review Time},
0, {Rough-In Date},
INT(NETWORKDAYS(FORMAT_DATE({Rough-In Date},"Y/M/D"),FORMAT_DATE({Rough-In Date},"Y/M/D"))), {Rough-In Date},
INT(NETWORKDAYS(FORMAT_DATE(ADD_DAYS({Rough-In Date},-1*INT({Sum Review Time}/5*7+1)), "Y/M/D"), FORMAT_DATE({Rough-In Date}, "Y/M/D"))), ADD_DAYS({Rough-In Date},-1*INT({Sum Review Time}/5*7+1)),
, "ERROR"), "MMM D, YYYY"), "")
``````
1 Like

@zrodgers

That looks familiar. Wherever did you find it? The main advantage of the original formula was that it could account for holidays.

For those that don’t care about holidays, here’s a better version. It’s much simpler and works no matter how many days you’re subtracting:

``````FORMAT_DATE(
SUBTRACT_DAYS({Date}, - {Days}
- SWITCH(WEEKDAY({Date}, 1),
1, FLOOR(({Days} + 0 ) / 5) * 2,
2, FLOOR(({Days} + 1 ) / 5) * 2,
3, FLOOR(({Days} + 2 ) / 5) * 2,
4, FLOOR(({Days} + 3 ) / 5) * 2,
5, FLOOR(({Days} + 4 ) / 5) * 2,
6, CEILING(({Days} + 1) / 5) * 2,
7, CEILING(({Days} + 1) / 5) * 2 - 1
)),
"YYYY-MM-DD")
``````

2 Likes

P.S.

For those looking to push (or pull in this case) a date directly, try this recipe from Column Magic : 2 Likes