# Countdown to a date with emoji | formula

Oct 9 '19 Β· 2 min read Β· 919 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 -