Upcoming database upgrades. Airtable functionality will be reduced for ~15 minutes at 06:00 UTC on Feb. 4 / 10:00 pm PT on Feb. 3. Learn more here

# Due Date based on number field (days task should be done before date)

229 6
cancel
Showing results for
Did you mean:
5 - Automation Enthusiast

Hi everyone.

I am trying to calculate a due date based on a specific date minus number of days before.

Example:

The master Date of a trip is 10/01/2022.

I have a column (DAYS BEFORE TRIP) where I enter the number of days that a specific task needs to be done before the trip. I have another Column (DUE DATE) that lists the due date based on that calculation. I need a formula that basically does this…

10/01/2022 - (DAYS BEFORE TRIP) = Due Date

So let’s say I need to book airfare 30 days before the trip. In the DAYS BEFORE TRIP field I would enter 30. My formula with then would calculate and display 09/01/2022 as the due date.

There are so many tasks that I don’t want to have the trip date listed every time so I want to embed the actual date in the formula. I hope this makes sense. Thanks for your help!

6 Replies 6
11 - Venus

Hi @Brian_Paul1
Can you try this formula?

``````DATEADD('10/1/2022', -{Days Before}, 'days')
``````
5 - Automation Enthusiast

This seems to be working, but for some reason it’s adding a due date to fields where there is no input yet. Any thoughts or ideas? Thank you!

11 - Venus
``````IF({Days Before} = '', '', DATETIME_FORMAT(DATEADD('10/1/2022', -{Days Before}, 'days'), 'MM/DD/YYYY'))
``````
5 - Automation Enthusiast

This worked great! Thank you so much. This formula will come in handy for so many things I work on.

16 - Uranus

If you want usable dates then use a formula that doesn’t force an output as a string.

``````IF({Days Before}, DATEADD('10/1/2022', -{Days Before}, 'days'))
``````
11 - Venus

Yes, use @Kamille_Parks formula instead of mine.