# Countdown to a date with emoji | formula

Oct 9 '19 · 2 min read · 1690 views  • Example table
Contents

## 📖 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 -