Login Page - Create Account

Support Board


Date/Time: Fri, 09 May 2025 14:43:54 +0000



Post From: Spreadsheet formula study to count occurences since session open bar

[2023-05-27 14:47:11]
Sawtooth - Posts: 4213
You have mixed the syntaxes between Alert syntax and spreadsheet syntax.

The Spreadsheet Formula study uses Alert syntax and, despite its name, is not a spreadsheet study.

How to calculate how many times events have occurred since the session open bar using the spreadsheet formula study?
You'll need to create a persistent variable using two IF statements.
Here is an example using spreadsheet syntax. You'll need to convert it to Alert syntax.
Spreadsheet Example Formulas and Usage: Count Events Since First Occurrence

For the Spreadsheet Formula study, like this:
=IF(AND(BARTIME>TIME(9,29,59),BARTIME<TIME(9,30,01)),0,IF(EventTrue,ID1.SG1[-1]+1,ID1.SG1[-1]))
where ID1 is the Spreadsheet Formula study

For the Spreadsheet Study study, like this e.g. in cell P3:
=IF(AND(FRACTIME(A3)>TIME(9,29,59),FRACTIME(A3)<TIME(9,30,01)),0,IF(EventTrue,P4+1,P4))
Date Time Of Last Edit: 2023-05-28 13:05:17