I made a short video to explain my challenge: https://vimeo.com/575868703/4099a1186a
Basically, I’d like to create a formula, so I get only the coming date within a list of dates. Hope someone can help me with this.
Thank you guys!
I made a short video to explain my challenge: https://vimeo.com/575868703/4099a1186a
Basically, I’d like to create a formula, so I get only the coming date within a list of dates. Hope someone can help me with this.
Thank you guys!
Best answer by Justin_Barrett
Welcome to the community, @Marc_Loskill! :grinning_face_with_big_eyes: Thanks for sharing the video, which really helps to clarify your desired goal. As you might have noticed, Airtable records can’t directly access other record data in the same table, so there’s no way to say, “Look at the previous/next record for comparison.” True, you could add a link field and link each record to the one before it, but a) that’s a pain, and b) even that has limitations.
My first thought was that slight variation of your second formula might work. Instead of checking to see if the date is in the same week as NOW(), add one week to NOW() and compare against that:
IF(IS_SAME({Webinar date}, DATEADD(NOW(), 1 "week"), "week"), "YES", "no")
If your webinars are mid-week, though, that’s going to start giving you “no” at the beginning of the week leading up to the next webinar, which isn’t what you want.
A more accurate method would be to use DATETIME_DIFF() to look at how many days there are until the next webinar date, and only mark those with “YES” where that difference is 14 days or less (I noticed that most of your dates are 14 days apart, though a couple varied from this pattern). Try this:
IF(
AND(
{Webinar date} > NOW(),
DATETIME_DIFF({Webinar date}, NOW(), "days") <= 14
),
"YES",
"no"
)

You could also simplify this a bit: drop the outer IF() function and the text output, which will put a 1 in the record of the next webinar, and a 0 in all the others. That would still allow you to filter for that next webinar (assuming that you’re using the output to drive a filter).
AND({Webinar date} > NOW(), DATETIME_DIFF({Webinar date}, NOW(), "days") <= 14)

If your schedule ever varies away from the 14-day pattern again, you could change 14 to a slightly higher number and it should still work.
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.