Use this formula when you want to sort a Notion task database by importance and how soon each task is due.
if(
prop("Status") == "Done",
0,
if(prop("Priority") == "High", 30, if(prop("Priority") == "Medium", 20, 10))
+ if(
empty(prop("Due Date")),
0,
if(dateBetween(prop("Due Date"), today(), "days") <= 1, 20,
if(dateBetween(prop("Due Date"), today(), "days") <= 7, 10, 0)
)
)
)What this formula does
The score combines priority and urgency:
| Factor | Points |
|---|---|
| High priority | 30 |
| Medium priority | 20 |
| Low or other priority | 10 |
| Due within 1 day | 20 |
| Due within 7 days | 10 |
| Completed task | 0 |
Higher scores should be handled first. The formula also works when a task has no due date.
Database setup
Create these properties in your Notion database:
| Property | Type | Example |
|---|---|---|
Task | Title | Prepare project brief |
Priority | Select | High, Medium, Low |
Due Date | Date | July 28, 2026 |
Status | Status or Select | Not started, In progress, Done |
Priority Score | Formula | The formula above |
Sort the database by Priority Score in descending order to keep the most urgent work at the top.
Use a simpler priority-only score
If you do not track due dates, use this version:
if(
prop("Priority") == "High",
3,
if(prop("Priority") == "Medium", 2, 1)
)Show a useful label instead of a number
Keep the numeric formula for sorting, and add a second formula property for a label:
if(
prop("Priority Score") >= 40,
"Do next",
if(prop("Priority Score") >= 20, "Plan soon", "Backlog")
)Common problems
If every task gets the same score, check the spelling and capitalization of your Select values. High, high, and Urgent are different values.
If completed tasks still appear near the top, check that the status value is exactly Done. Replace it with your actual completed status if needed.
If overdue tasks score too low, add a separate condition for negative day differences and give overdue work extra points.