- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jun 14, 2019 10:01 AM
I have two columns when a date is inserted in the first column the second column adds 20 days and populates a date which is fine, however I keep getting an error in the second column when a date in the first column has not been entered, what do I need to add in the formula so if the date is blank in the first column no error will be returned in the second column, thank you guys!
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jun 14, 2019 10:51 AM
Hi there! You could do this with an IF statement at the start to assess whether the “Requested Agreements” field is empty, i.e.
IF({Requested Agreements}="","",DATEADD({Requested Agreements},20,‘days’))
But that seems to mess with formatting and you end up with results like “2019-07-16T00:00:00.000Z”. Someone else might have a better solution to that, but you could use a LEFT formula to trim everything past the actual date, leaving you with:
IF({Requested Agreements}="","",LEFT(DATEADD({Requested Agreements},20,‘days’),10))
Does that work for you?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jun 14, 2019 01:19 PM
This should work, but when checking for blanks it’s usually better to drop the conditional statement. Airtable sometimes has trouble determining what is blank and what is not. I’m sure there are many others on the forum that can explain why this is much better than I can… I’ll try to find a better post about it and will link to it here.
Anyway, I would write the formula like this:
IF({Requested Agreements}, DATETIME_FORMAT(DATEADD({Requested Agreements}, 20, 'days'), 'M/D/YYYY'))
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jun 14, 2019 02:33 PM
Thanks for your input, but it still returned an error, the solution provided by Needs_Admin worked a treat.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jun 14, 2019 02:35 PM
Thank you so much worked first time just had to change the day and month at the end to suit us here in the UK.