- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Feb 15, 2021 02:24 AM
Hi there,
I’m trying to use the DATEADD function to calculate an end time for an event.
My formula is:
DATEADD({Timeslot StartTime},{Duration mins},‘minutes’)
{Duration mins} can be a lookup field or a formula field. I’ve tried all formatting options for these fields but none are producing the correct output.
If I make {Duration mins} a text field, the output is correct.
I need to make the formula work with {Duration mins} being either a lookup field or a formula ~ What am I doing wrong?
P.S. I have also tried to troubleshoot the issue by toggling the GMT settings on and off, all to no avail.
Thanks for your help.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Feb 20, 2021 10:51 PM
Thanks for following up!
Peter from Airtable support found an alternate solution:
DATEADD({Timeslot StartTime},ARRAYJOIN({Duration mins}),‘minutes’)
Here is his fully reply:
"I believe I’ve fixed the issue by “wrapping” the reference to the lookup field with an ARRAYJOIN() fuction, which converts the Lookup field from an array to a string (which in turn makes it interpretable by the DATEADD() function).
Totally get that this is not intuitive – I actually raised this very same issue to our product team a few weeks back, and am going to use your message as an opportunity to do so again."

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Feb 22, 2021 06:49 AM
Thanks for sharing what you got from Peter. Another function (that totally slipped my mind) that’s a little more intuitive is the SUM()
function. Normally it’s used to add a collection of values, but it works just as well when passed a single value in an array.
DATEADD({Timeslot StartTime}, SUM({Duration mins}), 'minutes')

- « Previous
-
- 1
- 2
- Next »