Countdown to a date with emoji | formula

Alex Sherwood
Oct 9 '19 Β· 2 min read Β· 919 views
πŸ‘‹
This guide explains how to check whether a date is today, within X days or overdue, to highlight that info in a calendar of birthdays in this instance. Notes starting with πŸ’‘ explain how a formula function works in Notion and notes starting with πŸ“ explain how a particular formula that I've created works. If you have any questions, please feel free to add a comment or ask them here.
  • Example table
Contents
🚨
If you get an error message about a β€˜syntax error’ when copying and pasting these formulas, try copying the β€˜Unformatted formula’ from the toggle list instead.

πŸ“– Guide

Get number of days between two dates

πŸ’‘ This formula will tell you that a date is 0 days away if it's tomorrow, 1 day away if it's the day after tomorrow etc. If you reverse the order of the dates that you're comparing then the formula will give you -1, rather than 1.
  • Unformatted formula
    dateBetween(prop("Birthday"), now(), "days")
dateBetween(prop("Birthday"), now(), "days")

πŸ”œ Birthday is in 30 days or less

  • Unformatted formula
    if(and(dateBetween(prop("Birthday"), now(), "days") <= 29, dateBetween(prop("Birthday"), now(), "days") >= 0), "πŸ”œ", "")
if(and( dateBetween(prop("Birthday"), now(), "days") <= 29, dateBetween(prop("Birthday"), now(), "days") >= 0), "πŸ”œ", "")

Days until birthday

  • Unformatted formula
    if(and(dateBetween(prop("Birthday"), now(), "days") <= 29, dateBetween(prop("Birthday"), now(), "days") >= 0), "In " + format(dateBetween(prop("Birthday"), now(), "days") + 1) + " days", "")
if(and( dateBetween(prop("Birthday"), now(), "days") <= 29, dateBetween(prop("Birthday"), now(), "days") >= 0), "In " + format(dateBetween(prop("Birthday"), now(), "days") + 1) + " days", "")

Get day of year from date

πŸ’‘ This will display how many days into a year a certain date is e.g. if the date is February 1st it will give you 32.
  • Unformatted formula
    toNumber(formatDate(prop("Birthday"), "DDD"))
toNumber(formatDate(prop("Birthday"), "DDD"))

πŸŽ‚ Birthday today

  • Unformatted formula
    if(toNumber(formatDate(prop("Birthday"), "DDD")) == toNumber(formatDate(now(), "DDD")), "πŸŽ‚", "")
if(toNumber(formatDate(prop("Birthday"), "DDD")) == toNumber(formatDate(now(), "DDD")), "πŸŽ‚", "")

🚨 Birthday is overdue

πŸ“ This formula is designed so that it'll only show the 🚨 alert if the πŸŽβœ… is not ticked. So once you've sent the present / birthday wishes, you can tick the property to get rid of the alert.
  • Unformatted formula
    if(and(dateBetween(prop("Birthday"), now(), "days") <= -1, prop("πŸŽβœ…") == false), "🚨", "")
if(and( dateBetween(prop("Birthday"), now(), "days") <= -1, prop("πŸŽβœ…") == false), "🚨", "")

🎊 Finished formulas

Finished formula (including birthday in 30 days or less)

πŸ“ This formula will display πŸ”œ if the birthday's due within 30 days or less, using this formula.
  • Unformatted formula
    if(toNumber(formatDate(prop("Birthday"), "DDD")) == toNumber(formatDate(now(), "DDD")), "πŸŽ‚", if(and(dateBetween(prop("Birthday"), now(), "days") <= 29, dateBetween(prop("Birthday"), now(), "days") >= 0), "πŸ”œ", if(and(dateBetween(prop("Birthday"), now(), "days") <= -1, prop("πŸŽβœ…") == false), "🚨", "")))
if(toNumber(formatDate(prop("Birthday"), "DDD")) == toNumber(formatDate(now(), "DDD")), "πŸŽ‚", if(and( dateBetween(prop("Birthday"), now(), "days") <= 29, dateBetween(prop("Birthday"), now(), "days") >= 0), "πŸ”œ", if(and( dateBetween(prop("Birthday"), now(), "days") <= -1, prop("πŸŽβœ…") == false), "🚨", "")))

Finished formula (including days until)

πŸ“ This formula will display "In [x] days" if the birthday's due within 30 days or less, using this formula.
  • Unformatted formula
    if(and(toNumber(formatDate(prop("Birthday"), "DDD")) - toNumber(formatDate(now(), "DDD")) <= 30, toNumber(formatDate(prop("Birthday"), "DDD")) - toNumber(formatDate(now(), "DDD")) > 1), "In " + format(toNumber(formatDate(prop("Birthday"), "DDD")) - toNumber(formatDate(now(), "DDD"))) + " days", if(toNumber(formatDate(prop("Birthday"), "DDD")) == toNumber(formatDate(now(), "DDD")), "πŸŽ‚", if(and(toNumber(formatDate(prop("Birthday"), "DDD")) < toNumber(formatDate(now(), "DDD")), prop("πŸŽβœ…") == false), "🚨", "")))
if(toNumber(formatDate(prop("Birthday"), "DDD")) == toNumber(formatDate(now(), "DDD")), "πŸŽ‚", if(and( dateBetween(prop("Birthday"), now(), "days") <= 29, dateBetween(prop("Birthday"), now(), "days") >= 0), "In " + format(dateBetween(prop("Birthday"), now(), "days") + 1) + " days", if(and( dateBetween(prop("Birthday"), now(), "days") <= -1, prop("πŸŽβœ…") == false), "🚨", "")))

If you're still learning to use Notion, I'd highly recommend checking out Francesco D'Alessio's courses -
(this is an affiliate link, I'll receive 30% of fees that you pay for if you sign up after using this link)
Updating...

Share on