Notion Answers

Help between Notion users


Register & Ask

It's free & easy

Get answers

Answers, votes & comments

Vote and select answers

Receive points, vote and give the solution

Question

1vote

Format number of days into years, months and days

can i format teh results of datebetween into years and months?

2 Answers

1vote

nutsinbox Points290

See if this helps. I couldn't think of a way that keeps the month and the year, but there's a way to show up the months:

concat(format(abs(dateBetween(prop("Start date"), prop("End date"), "months"))) + " months")

Or even, if you just want the number:

abs(dateBetween(prop("Start date"), prop("End date"), "months"))

1vote

Hi, this formula will give you Years and Months between the set dates.

E.g. if the "Start date" was December 4th 2020 and the "End date" was July 17th 2023 the result would show:

3 Years 7 Months

concat(format(abs(floor(dateBetween(prop("Start date"), prop("End date"), "months") / 12))), " Years ", format(abs(mod(dateBetween(prop("Start date"), prop("End date"), "months"), 12))), " Months")

0vote

brownsugar7210 commented

Hi Martin,

I've been using your Notion Years and Months between calculation formula and it works great. However, I'm having trouble adapting it for cases where the "End Date" is not defined. I'd like the formula to default to using the current date (now()), but I'm running into issues when trying to implement this.

Could you provide some guidance on how to modify your formula so it uses now() when the "End Date" is not defined? Any assistance you could offer would be greatly appreciated.

Thanks in advance xx

1vote

Martin_SystemsHill commented

Hi,

this is the formula that relates the number of years and months to "now" every time:

Hope it helps.

concat(format(abs(floor(dateBetween(prop("Start date"), now(), "months") / 12))), " years ", format(abs(mod(dateBetween(prop("Start date"), now(), "months"), 12))), " months")

Please log in or register to answer this question.

...

Welcome to Notion Answers, where you can ask questions and receive answers from other members of the community.

Please share to grow the Notion Community!

Connect