LogoFLO.W
  • Pricing
  • Blog
  • Docs
  • Thinking
  • About
Get Started
  • Reader's Question
  • My Answer
  • Create Rollup Properties
  • Use the dateRange Function to Combine Dates
  • Use formatDate and parseDate to Remove Unnecessary Time
  • Complete Database
  • Reference Template
Notion 问答·
2025/03/05

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.

avatar for 二一
二一
How to Calculate the Time Range of Sub-items in Notion

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:

Sub-task time example

My Answer

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

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

Project-Task structured database

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

Target effect

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.

Create Rollup properties

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.

Rollup time duration

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.

dateRange function combination

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:

Final effect

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:

Complete database

Reference Template

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


📘 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✨ 1237+ users chose FLO.W
2025/03/05
Share this post
All Posts

More Posts

How to Merge Multiple Calendar Databases in Notion?
#Notion 问答

How to Merge Multiple Calendar Databases in Notion?

Two methods to merge multiple Notion database calendars into one view: linked views and Home view.

2024/05/19
How to Create a Birthday Countdown Reminder in Notion
#Notion 问答

How to Create a Birthday Countdown Reminder in Notion

Use Notion formulas to create a birthday countdown reminder that automatically calculates the days until the next birthday, with support for table, calendar, and gallery views.

2025/03/16
How to Implement Random Review in Notion Using Formulas
#Notion 问答

How to Implement Random Review in Notion Using Formulas

Learn how to generate pseudo-random numbers using Notion Formulas to randomly sort and browse database content, showing a different order each time you refresh the page.

2024/08/19

Newsletter

Join the community

Subscribe to our newsletter for the latest news and updates

LogoFLO.W
TwitterX (Twitter)YouTubeYouTubeBilibiliXiaoHongShuEmail
Product
  • Features
  • Pricing
  • FAQ
Resources
  • Blog
  • Documentation
  • Notion Custom Agent
Company
  • About
  • Contact
Legal
  • Cookie Policy
  • Privacy Policy
  • Terms of Service

Subscribe for more Notion tips and updates

© 2026 FLO.W, All rights reservedNotion is a trademark of Notion Labs, Inc. This is an independent third-party site, not affiliated with or endorsed by Notion.
Featured on Uneed