Notion Answers

Get help from other 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

2votes

I'm working on a CV template that will update the "elapsed time" column while on assignment and calculate the "elapsed time" on past assignments.

Basically:

Calculate time between End Date and Start Date, however for end date, if it is empty (indicating a current assignment), it would return today's date, otherwise it would return the value for end date, and display the difference in years (preferably by calculating days / 365 so I can get partial years).

I did some research and came up with this although I have syntax errors I can't identify (please be gentle, my coding experience can be measured in minutes).

dateBetween (
if (
end( prop("Start_Date") ) == "", now(), end( prop("Start_Date")
),
start( prop("Start_Date"), "Years"
)

Also, I still haven't yet grasped how to use the format function to display it all in days so I can divide by 365 to get partial years (so that if < 12 months it doesn't display as 0).

Not even sure if this part is necessary, just presumed. I haven't been able to get it to work to test if 10 months displays as 0.9 years or as 0 because it isn't "1" year

I would assume it would be some method of nesting the entire statement into a Format() tag and then dividing it at the end, then using join to add "years" but my lack of coffee this morning has my eyes glazing when I try to figure it out.

Appreciate any help someone can provide.

-MO

Please log in or register to answer this question.

Exclusive for Notion Answers Users

...

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