Login Page - Create Account

Support Board


Date/Time: Sat, 07 Jun 2025 20:03:20 +0000



Spreadsheet formula efficiency

View Count: 444

[2023-02-16 13:51:43]
User247273 - Posts: 39
I realize this might be a dumb question, but is it possible to tell me which of these two formulas below is the most efficient way to get my answer? I have several columns across several sheets with similar types of evaluations so I'm trying to make sure I minimize the demand on my CPU as much as possible. If there's a help page related to this, can you point me in that direction as well. I got a little turned around in my research.

Option A: =IF(AND(O3=1,P3=1,Q3=1,R=1,S3=1),1,0)
Option B: =IF(SUM(O3:S3)=5,1,0)

I'm constructing a spreadsheet system for trading and it looks like I'll need this type of evaluation in about 21000 cells (7 columns * 6 sheets * 500 rows). Even though I'm only evaluating once per bar, I'd like to get the sheets to calculate as fast as possible.
[2023-02-16 14:24:20]
Sierra_Chart Engineering - Posts: 19859
Option A is definitely more efficient.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2023-02-18 20:41:37]
Sierra_Chart Engineering - Posts: 19859
Regarding what is optimal: `AND` or `SUM`.

If the values in O3:R3 are in fact boolean values (0 is false and non-zero is true) then the code
`=IF(AND(O3=1,P3=1,Q3=1,R=1,S3=1),1,0)`

can be optimized further:

`=IF(AND(O3,P3,Q3,R3,S3),1,0)`

because the `boolean` values are stored as a numerical (double) and can be used interchangable.

It reduced computation time by means of ommiting comparison operation (`=`).
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
Date Time Of Last Edit: 2023-02-18 20:41:43

To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account