Add months and subtract days

Hi, just started using Airtable and I think it’s great. I was wondering if it’s possible to use the DATEADD() function to add a set number of months and subtract a set number of days in the same formula. I realise I could create two fields, one with DATEADD() for the months and a second with DATEADD() to subtract the days but just wondering if there’s a more elegant solution?

Any help would be appreciated.

Thanks

Hi there, James! Welcome to the community!

You can absolutely do this. Let’s say we want to add one month, and subtract one day. I would write the formula like this:

IF({Date}, DATEADD(DATEADD({Date}, 1, 'month'), -1, 'day'))

If {Date} were today, 11/17/2019, the above would give us a result of 12/16/2019.

You could write this without wrapping it in the IF() statement, but I recommend using it to avoid getting #ERROR! when the field {Date} is empty :slight_smile:

1 Like

That’s great, thanks!

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.