Help between Notion users

It's free & easy

Receive points, vote and give the solution

1vote

help to to a formula on notion on a subtract matter!!

I need a formula that, when I subtract two numbers, the answer is not a negative number, but shows up as "empty"

so, in this way, when the property is empty I'll not show up in the place

like "if the death part is empty, substract "year", "born", but if the death shows up, substract "death", "born""

(i try to write this on formula but i can get it right, so please, helpp)

1vote

Hi, here you go.

This formula should be close to what you have explained.
Let me know if you were looking for something else.

``````lets(
Y, floor(abs(dateBetween(prop("death"), prop("born"), "months") / 12)),
M, abs(dateBetween(prop("death"), prop("born"), "months") % 12),
D, dateBetween(prop("death"), prop("born"), "days"),

if(empty(prop("death")) || empty(prop("born")) || D<0, "",
ifs(Y==0, "", Y==1, "1 year ", format(Y + " years ")) +
ifs(M==0, "", M==1, "1 month ", format(M + " months ")) +
ifs(Y==0 and M==0 and D==1, "1 day", Y==0 and M==0, format(D + " days"))

))``````