Do you want the Worksheet or the data file, or both?
I do not have much luck with uploading files but I am very happy to try again and also send you a link if you can confirm what you need.
As a first attempt I am attaching the worksheet and the spreadsheet with the data. If it does not work then I will send you a link.
My question originally was how to extract the values that are more positive than -1 (Eref) and then to determine the longest continuous period where they are all more positive than Eref.
Then to sum all the periods more positive than Eref and more negative than Eref.
These values are then applied to the criterion formula.
Perhaps I did not do it in the most elegant way but I did eventually manage to do it with some help.