Skip to main content
2026 Efficiency Upgrade - Save ¥30 on Templates
Coupon Code:FLOW3DAYS
Only 0 days left 09:05:43

How to Calculate the Time Range of Sub-items in Notion

Use Notion Rollup and the dateRange function to automatically calculate the time range of sub-tasks, enabling automatic date calculation for parent items.

This question comes from a reader of the Notion course. It has been organized and shared here. If you encounter similar issues while using Notion, feel free to leave a comment.

Reader's Question

Can the task dates in a database be automatically calculated based on the dates of all its sub-tasks? As shown below:

My Answer

You can use the Rollup property to help solve this problem.

Suppose we have built a "Project - Task" structured database like this:

The goal now is to calculate the time range of all sub-tasks on the "Project" page, achieving an effect like this:

Here is the detailed solution.

Create Rollup Properties

First, the Rollup property has a built-in date range calculation feature, so we can create two Rollup properties to calculate the "earliest date" and "latest date" of sub-tasks respectively.

Of course, you could also use a Rollup property directly to calculate the total time range of sub-tasks, but this would only calculate the time duration and cannot display it in a "Date 1 → Date 2" format.

Use the dateRange Function to Combine Dates

So we can create a Formula property and use the dateRange function to combine the "earliest date" and "latest date" together.

However, you will notice that the resulting time format is @Feb 28, 2025 00:00 → May 18, 2025 00:00, showing an unwanted 00:00. This is because all dates default to 00:00 for the time portion.

Use formatDate and parseDate to Remove Unnecessary Time

So we can first use the formatDate and parseDate functions to process the "earliest date" and "latest date", and then use dateRange to combine them.

The result looks like this:

Full formula:

dateRange(Start Time.formatDate("YYYY-MM-DD").parseDate(),End Time.formatDate("YYYY-MM-DD").parseDate())

Complete Database

The complete database looks like this:

Reference Template

Reference template link: https://leon21.notion.site/Sub-item-1ad0e68aa04680cb806fff894d15f29a?pvs=4

If you also encounter the issue where Sub-items collapse every time you refresh, check out this tutorial on how to auto-expand database sub-items.


📘 FLO.W — Notion Personal Management System

FLO.W is a Notion-based personal management template that integrates tasks, notes, projects, habits, and more, complete with comprehensive tutorials.

Ready-to-use Notion template system
Complete tutorials included, beginner-friendly
Continuously updated and maintained
Learn About FLO.W Template✨ 1531+ users chose FLO.W
Share this post
二一

Notion 深度用户,专注于知识管理和效率工具的研究与实践

Newsletter

Join the community

Subscribe to our newsletter for the latest news and updates