Login Page - Create Account

Support Board


Date/Time: Fri, 04 Oct 2024 14:19:56 +0000



New Spreadsheets OR function

View Count: 982

[2014-11-20 23:17:11]
Sawtooth - Posts: 4093
This works:
=IF(OR(A4=0,INT(A3)>INT(A4)),K4+1,K4)

This gives a #VALUE! error:
=IF(OR(INT(A3)>INT(A4),A4=0),K4+1,K4)

Both formulas work in the Old Spreadsheets version.

It errors because row 1003 is blank with a 1000 Number of Rows setting.
In the Old Spreadsheets version, I don't need to check for a 0 in row 1003:
=IF(INT(A3)>INT(A4),K4+1,K4)

1) Why is there a precedence in the OR function?
2) Why is there now a need to check for a 0 in a blank row beyond the Number of Rows setting?
[2014-11-24 17:59:55]
Sierra Chart Engineering - Posts: 104368
1.

1) Why is there a precedence in the OR function?
For efficiency, the OR function returns TRUE or an error the first chance that it gets, without checking the rest of the parameters.

2.

2) Why is there now a need to check for a 0 in a blank row beyond the Number of Rows setting?

It is not necessary to check for 0 in a blank row, however the INT function returns a #VALUE! error if it is given an empty value, as is described in the description for the function:


Rounds the given Number down to the next whole integer. Returns #VALUE! if the given Number is not a number.

Therefore, checking that A4 is not empty before the call to INT is necessary to not get a #VALUE! error on the last row.

3. The Old Spreadsheet's INT function returns 0 when it is given an empty value.


4. We have changed the INT function of the Internal Spreadsheet Components to return 0 if it is given an empty value. This will be out in the next release.


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, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing

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

Login

Login Page - Create Account