How to Check If a Date Falls Within 30 Days of Another Date in Airtable

Whether you need to flag upcoming renewals, check if a follow-up is overdue, or see if two dates are close enough to conflict, the pattern is the same: calculate the difference between two dates and check whether it falls within a threshold.

Airtable showing whether a target date falls within 30 days of a reference date

The Basic Formula

To check if a date field is within the next 30 days of today, meaning today or up to 30 days in the future:

IF(
 AND(
 DATETIME_DIFF({Target Date}, TODAY(), 'days') >= 0,
 DATETIME_DIFF({Target Date}, TODAY(), 'days') <= 30
 ),
 "Within 30 days",
 "Outside 30 days"
)

This returns "Within 30 days" if the target date is between today and 30 days from now. The >= 0 condition is what excludes past dates, so this version only looks forward, which fits renewal or deadline style checks.

If instead you want to know whether a date is within 30 days in either direction, past or future, use ABS() to check the distance regardless of which way it points:

IF(
 ABS(DATETIME_DIFF({Target Date}, TODAY(), 'days')) <= 30,
 "Within 30 days",
 "Outside 30 days"
)

To check relative to another date field rather than today, replace TODAY() with {Reference Date} in either version:

IF(
 ABS(DATETIME_DIFF({Target Date}, {Reference Date}, 'days')) <= 30,
 TRUE(),
 FALSE()
)

Format the formula output as a checkbox to get a visual true or false indicator, or leave it as text for filtering purposes. The field stays a formula field either way; you're just changing how Airtable displays a boolean result.

Using It for Filtering and Alerts

Once you have the formula field, filtering and automation become straightforward.

In a view: add a filter where the formula field equals "Within 30 days" (or is checked, if formatted as a checkbox). The view now shows only the approaching records.

In an automation: there are two reasonable approaches depending on when you want to act. Use "When record matches conditions" with a condition on the formula field if you want the automation to fire the moment a record crosses into the window. Use "At a scheduled time" with a daily Find records step if you'd rather check the whole table once a day and send a batch of reminders together. For date-based reminders, the daily scheduled approach is usually the simpler one to reason about. See how to automate expiry date reminders in Airtable for the full automation pattern.

Checking Against an Array of Dates (Rollup Fields)

If your date is a lookup field that returns an array of dates, for example looking up event dates from multiple linked records, DATETIME_DIFF won't work directly since it expects a single value, not an array.

It's tempting to reach for a MIN(values) or MAX(values) rollup here, pulling the earliest or latest date out of the array and running the 30-day check against just that one value. That only answers a narrower question than "is any date in the array within 30 days," though.

If your array contains January 1, June 20, and December 1, and you're checking against June 15, the date that's actually close (June 20) isn't the earliest or the latest date in the array, so a MIN or MAX based check misses it. Use MIN or MAX here only if your real requirement genuinely is about the earliest or latest linked date specifically, not about whether any of them qualifies.

To correctly check whether any linked date falls within 30 days, do the comparison on the linked table itself, then roll up the result:

  1. On the linked table, add a lookup field that pulls in the reference date (Date A) from the parent record, using the same link that connects the two tables.
  2. Still on the linked table, add a formula field, for example Within 30 Days?, that compares that record's own date field to the looked up reference date:
ABS(DATETIME_DIFF({Date}, {Date A (from parent)}, 'days')) <= 30
  1. Back on the parent table, add a rollup field that rolls up through the same link, aggregating the Within 30 Days? field with:
OR(values)

This returns true if at least one linked record's Within 30 Days? formula is true, and false only if none of them are. Because the comparison happens per linked record rather than being collapsed down to a single earliest or latest value first, this version correctly catches any date in the array that falls inside the window, regardless of where it sits relative to the others.

For a deeper look at DATETIME_DIFF behaviour and common calculation mistakes, see why DATETIME_DIFF shows the wrong value in Airtable.