Derived variables from data within a time range

I would like to create a derived variable using formulae containing data from current timestamp and calculated values from previous timestamps and timerange.
Example:
Timestamp Value of var1 Derived value
Initial t + 0s 100 100
100s 105 102.5*(100-0)/86400 +100 = 100.11
200s 102 103.5*(200-100)/86400 + 100.11 = 100.23
400s 101 101.5*(400-200)/86400 +100.23 = 100.46

timestamps are asynchronous and calculation uses elapsed time since previous data.

Can someone point me in the right direction?