Subtract 2 Business Days From Date

I have a date column and need to create a new column containing dates that are two workdays / business days before the given date. So e.g. 2023-11-07 → 2023-11-03

Is there a way to do this within a flow?

Hi @Will_Kidger - Happy to help! It looks like you should be able to do this by using the following steps:

  • Format dates to create two new columns from your date column: one with the date in Unix (X) format and the other with the day of the week (dddd)
  • Use the If/else step to determine how many seconds needs to be subtracted from the date based on the day of the week column
  • Use the math column to subtract the column created by the if/else step from the unix formatted column
  • Finally, reformat dates and edit columns to remove the extra columns that were created

I’ve created this snippet with those steps set up so you can paste them directly into your Flow, you’ll just need to adjust the selected columns in the first format dates step:

parabola:cb:32b1e521-c2f6-4d2d-a81b-f0c18175c517

How to use snippets

Let me know if you have any questions!

1 Like