Use this formula to show whether an item is due today, still has time left, or is already overdue.
if(
empty(prop("Deadline")),
"No deadline",
lets(
days, dateBetween(prop("Deadline"), today(), "days"),
if(
days < 0,
format(abs(days)) + " days overdue",
if(days == 0, "Due today", format(days) + " days left")
)
)
)What this formula does
The formula compares Deadline with today's date:
| Result | Meaning |
|---|---|
No deadline | The date property is empty |
Due today | The deadline is today |
5 days left | The deadline is five days away |
2 days overdue | The deadline was two days ago |
dateBetween() returns the number of whole days between the deadline and today. A negative value means the deadline has passed.
Database setup
Create these properties in your Notion database:
| Property | Type | Example |
|---|---|---|
Deadline | Date | July 30, 2026 |
Time remaining | Formula | The formula above |
If your date property is called Due Date, replace every prop("Deadline") reference with prop("Due Date").
Return only the number of days
Use this shorter variant when you want a number for sorting or filtering:
if(
empty(prop("Deadline")),
0,
dateBetween(prop("Deadline"), today(), "days")
)Positive numbers are days remaining. Zero means due today, and negative numbers are overdue days.
Add a status label with color
This version makes each state easier to scan in a database view:
if(
empty(prop("Deadline")),
style("No deadline", "gray"),
lets(
days, dateBetween(prop("Deadline"), today(), "days"),
if(
days < 0,
style(format(abs(days)) + " days overdue", "red", "b"),
if(
days == 0,
style("Due today", "yellow", "b"),
style(format(days) + " days left", "green")
)
)
)
)Common problems
If the formula shows No deadline, confirm that Deadline is a Date property, not a text property. Also check that the property name matches exactly, including spaces and capitalization.
If the result is one day different from what you expect, check the time zone and whether the date includes a time. This formula compares calendar dates with today(), which is usually best for date-only deadlines.
If you want to ignore completed tasks, add a Status property and wrap the formula in a check for prop("Status") == "Done".
When to use this formula
This formula works well for project tasks, content calendars, application deadlines, renewals, invoices, and launch checklists.