Formula that retrieves the value of the previous record of a specific column

Hi guys, I'm still struggling with a formula.
I need to insert a formula into a column that recovers the value of the previous row of the same column and once the value is recovered it adds it to 15.
I also need to insert the date constraint, if the date is not present in any previous record then the value of this column is 0, in all other cases the value is always equal to the value of the previous column row added to 15.

I add a screenshot of my formula that doesn't work, the first part of the formula checks if there are other records that have the same date that you are trying to insert, if you use the value 0, if not I try to recover the previous value and add to 15, but it doesn't work as you can see from the screenshot.

table a.JPG

Is there anyone who can give me a hand?
Thank you

0 1 87
1 REPLY 1

I think I solved it this way, I posted the solution and the tests carried out could perhaps be useful to someone

formula secondi.JPGdue.JPG

Top Labels in this Space