![Meagan_Caesar Meagan_Caesar](https://community.airtable.com/legacyfs/online/avatars/3X/1/0/1065c0e1dd65e55c41c515535c34fa922c1b39f4.jpeg)
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎Jun 01, 2023 10:50 PM - edited ‎Jun 01, 2023 10:53 PM
Hi, I'm sure the answer to this is really simple and I'm just missing it, but could someone please take a look at this formula and let me know why some records would be throwing an ERROR, but others are working? I'm thinking I've got something in the wrong order maybe?
We have a group events calendar set up and most events are one-off events, but we have a couple of recurring ones that I'd like to set up an Automation for to automatically generate the next event.
This is the formula I'm using:
Solved! Go to Solution.
Accepted Solutions
![kuovonne kuovonne](https://community.airtable.com/legacyfs/online/avatars/3X/b/c/bcecb2d58f8302e9d9f520621c02ff41be54488c.jpeg)
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎Jun 02, 2023 07:09 AM
Using DATETIME_FORMAT() and SET_TIMEZONE() should be unnecessary. You can set the timezone shown in the formatting options of the formula.
IF(
AND( {Date & Time}, {Recurring Events}),
DATE_ADD({Date & Time}, 1, "weeks")
)
![Stephen_Orr1 Stephen_Orr1](https://community.airtable.com/legacyfs/online/avatars/3X/7/c/7cf878b53d662ce3ab79db941c631109f3246b48.png)
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎Jun 02, 2023 01:53 AM - edited ‎Jun 02, 2023 01:59 AM
Hi @Meagan_Caesar!
It's likely that the error is caused by an empty {Date & Time} field value.
You can add an IF check on this field to remove the error like:
This is saying, if {Date & Time} is populated, do the inner formula, otherwise, return blank (noted as "").
IF({checkbox},
Hope that helps!
![kuovonne kuovonne](https://community.airtable.com/legacyfs/online/avatars/3X/b/c/bcecb2d58f8302e9d9f520621c02ff41be54488c.jpeg)
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎Jun 02, 2023 07:09 AM
Using DATETIME_FORMAT() and SET_TIMEZONE() should be unnecessary. You can set the timezone shown in the formatting options of the formula.
IF(
AND( {Date & Time}, {Recurring Events}),
DATE_ADD({Date & Time}, 1, "weeks")
)
![Meagan_Caesar Meagan_Caesar](https://community.airtable.com/legacyfs/online/avatars/3X/1/0/1065c0e1dd65e55c41c515535c34fa922c1b39f4.jpeg)
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎Jun 02, 2023 05:17 PM
Thanks Stephen, this is great info and helps me better understand how to structure these sorts of formulas in the future. Weirdly, there weren't any missing dates, so I'm not sure what was throwing the error, but both your response and Kuovonne's work, so thank you.
![Meagan_Caesar Meagan_Caesar](https://community.airtable.com/legacyfs/online/avatars/3X/1/0/1065c0e1dd65e55c41c515535c34fa922c1b39f4.jpeg)
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎Jun 02, 2023 05:18 PM
Thanks Kuovonne, this works perfectly and is nice and simple.
![Stephen_Orr1 Stephen_Orr1](https://community.airtable.com/legacyfs/online/avatars/3X/7/c/7cf878b53d662ce3ab79db941c631109f3246b48.png)
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎Jun 02, 2023 05:25 PM
Happy to help!
![Meagan_Caesar Meagan_Caesar](https://community.airtable.com/legacyfs/online/avatars/3X/1/0/1065c0e1dd65e55c41c515535c34fa922c1b39f4.jpeg)
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎Jun 04, 2023 04:57 PM
Hi @kuovonne and @Stephen_Orr1 ,
In addition to this question, I'm trying to set up a field to automatically generate due dates based on certain submissions. Here's what I have, but it won't format as a date, only as the string, so I'm not sure what's not working. It seems to only happen when I add the IF statement.
![](/skins/images/FE00829FDD2AE889FAB731D8F02A8942/responsive_peak/images/icon_anonymous_message.png)