<aside> <img src="https://s3-us-west-2.amazonaws.com/secure.notion-static.com/a5a1e3ce-00fa-46e4-9a75-58c2aed9e8ce/Notion_Fundamentals_with_Thomas_Frank_-_Avatar_2021.png" alt="https://s3-us-west-2.amazonaws.com/secure.notion-static.com/a5a1e3ce-00fa-46e4-9a75-58c2aed9e8ce/Notion_Fundamentals_with_Thomas_Frank_-_Avatar_2021.png" width="40px" /> The example database below determines each person’s next birthday based on their Birth Date, as well as the current date.
Created by Thomas Frank | Learn Notion Formulas | Notion Basics | Templates | Twitter
</aside>
// Compressed
dateAdd(prop("Birth Date"), year(now()) - year(prop("Birth Date")) + if(month(prop("Birth Date")) == month(now()) and date(prop("Birth Date")) >= date(now()) or month(prop("Birth Date")) > month(now()), 0, 1), "years")
// Expanded
dateAdd(
prop("Birth Date"),
year(
now()
) -
year(
prop("Birth Date")
) +
if(
month(
prop("Birth Date")
) == month(
now()
) and date(
prop("Birth Date")
) >= date(
now()
) or month(
prop("Birth Date")
) > month(
now()
),
0,
1
),
"years"
)