I am trying to write a script or formula that will average two cells, at times t and t-1 stored on different rows, if the item ID matches. I think the steps would be as follows
If Item row 2 = Item row 1
(value row 2 + value row 1)/2
store result in average row 2
else leave blank
Please see the table below for an example. I put the expected answers in the Average column. I am fine with a scripting answer. Thank you.
Go to Solution
If(:item == lag(:item), sum(:value, lag(:value))/2);
The above formula should work
View solution in original post
There are no labels assigned to this post.