Skip to main content

Formula - add 7 days excluding Sundays and Holidays

  • August 3, 2023
  • 2 replies
  • 413 views

Forum|alt.badge.img+1

I need to create a formula that will add 7 days to a manually entered date excluding Sundays and Holidays.

--- This is an item that gets mailed, and I need to mail it 7-days before the "due date." Hence, no Sundays or Holidays.

Any help or a point in the right direction would be most appreciated!

2 replies

joshsorenson
Forum|alt.badge.img+9
  • Participating Frequently
  • 34 replies
  • August 5, 2023

Airtable does have a `WORKDAY()` function that allows you to calculate a date that is a certain number of workdays from a start date, excluding weekends (Saturday and Sunday) and, optionally, a list of dates that should be excluded (such as holidays).

Here's an example of how you might use the `WORKDAY()` function to solve your problem:

1. Create a field `Start Date` where you will input the initial date.
2. Create a list of holidays in a field, entering dates in a format separated by commas.
3. Create a final field, `End Date` with the formula:

WORKDAY({Start Date}, -7, {Holiday List})

The `-7` is used because the `WORKDAY()` function will calculate a future date if given a positive number and a past date if given a negative number. Since you want to mail the item 7 days before the due date, you need to use `-7` to get the correct date. This formula will return a date that is 7 workdays before the start date, excluding weekends and the holidays that you specified.


Forum|alt.badge.img+2
  • New Participant
  • 2 replies
  • September 6, 2023

Airtable does have a `WORKDAY()` function that allows you to calculate a date that is a certain number of workdays from a start date, excluding weekends (Saturday and Sunday) and, optionally, a list of dates that should be excluded (such as holidays).

Here's an example of how you might use the `WORKDAY()` function to solve your problem:

1. Create a field `Start Date` where you will input the initial date.
2. Create a list of holidays in a field, entering dates in a format separated by commas.
3. Create a final field, `End Date` with the formula:

WORKDAY({Start Date}, -7, {Holiday List})

The `-7` is used because the `WORKDAY()` function will calculate a future date if given a positive number and a past date if given a negative number. Since you want to mail the item 7 days before the due date, you need to use `-7` to get the correct date. This formula will return a date that is 7 workdays before the start date, excluding weekends and the holidays that you specified.


I was just trying to figure out the holiday list part and you figured it out! Do you have a sample airtable I can reference? I'm trying to figure out the response time of support inquiries from various companies but wanted to exclude weekends and holidays.