R Squared Formula Behaving differently in two sheets for the same DataRange.

Posted by: kapil-fp on 8 September 2017, 2:50 pm EST

  • Posted 8 September 2017, 2:50 pm EST

    Hi Guys,


    I am using Farpoint 5.0 for My window application.


    I got stuck at one point  where the 'R Squared' formula giving different output for the same set of inputs.


    here is the details for the same,


    i) R Squared formula used in Form1


    =RSQ({0.044112796833773},{-0.008370832778813})


    and the output is <FONT style="BACKGROUND-COLOR:#ffff33;">#DIV/0!</FONT>


    ii) R Squared formula used in Form2


    =RSQ({0.044112796833773},{-0.008370832778813})


    and the output is <FONT style="BACKGROUND-COLOR:#ffff33;">7.17230609057783</FONT>


     


    Can anyone help me out why this is happing,


    Thanks in advance.


     


     

  • Replied 8 September 2017, 2:50 pm EST

    Hello,

    The R Squared formula has two arguments, known_y's and known_x's and if they contain only one data point, RSQ returns the #DIV/0! error value. I tried to use the formula suggested by you on two different forms and every time I got  the same error, which is the expected behavior as the formula is incorrect. The formula needs more than one value in the arrays to evaluate correctly. I am not very sure how it is working in one of the forms, I would request you to provide me a sample depicting your issue so that I can debug it further.

    Thanks,

    Manpreet Kaur.

  • Replied 8 September 2017, 2:50 pm EST

    <FONT color=#2b91af size=2 face=Consolas><FONT color=#2b91af size=2 face=Consolas><FONT color=#2b91af size=2 face=Consolas>

    <FONT color=#0000ff size=2 face=Consolas><FONT color=#0000ff size=2 face=Consolas><FONT color=#0000ff size=2 face=Consolas>using</FONT></FONT></FONT><FONT size=2 face=Consolas><FONT size=2 face=Consolas><FONT color=#000000> FarPoint.Win.Spread.Model;</FONT>

    </FONT></FONT><FONT color=#0000ff size=2 face=Consolas><FONT color=#0000ff size=2 face=Consolas><FONT color=#0000ff size=2 face=Consolas>

    using</FONT></FONT></FONT><FONT size=2 face=Consolas><FONT size=2 face=Consolas><FONT color=#000000> FarPoint.Win.Spread.DrawingSpace;</FONT>

    </FONT></FONT><FONT color=#0000ff size=2 face=Consolas><FONT color=#0000ff size=2 face=Consolas><FONT color=#0000ff size=2 face=Consolas>

    using</FONT></FONT></FONT><FONT size=2 face=Consolas><FONT size=2 face=Consolas><FONT color=#000000> FarPoint.Win;</FONT>

    </FONT></FONT><FONT color=#0000ff size=2 face=Consolas><FONT color=#0000ff size=2 face=Consolas><FONT color=#0000ff size=2 face=Consolas>

    using</FONT></FONT></FONT><FONT size=2 face=Consolas><FONT size=2 face=Consolas><FONT color=#000000> FarPoint.Win.Spread;</FONT>

    </FONT></FONT><FONT color=#0000ff size=2 face=Consolas><FONT color=#0000ff size=2 face=Consolas><FONT color=#0000ff size=2 face=Consolas>

    using</FONT></FONT></FONT><FONT size=2 face=Consolas><FONT size=2 face=Consolas><FONT color=#000000> FarPoint.Win.Spread.CellType;</FONT>

    </FONT></FONT><FONT size=2 face=Consolas><FONT size=2 face=Consolas>

    </FONT></FONT><FONT color=#0000ff size=2 face=Consolas><FONT color=#0000ff size=2 face=Consolas><FONT color=#0000ff size=2 face=Consolas>public</FONT></FONT></FONT><FONT size=2 face=Consolas><FONT size=2 face=Consolas> </FONT></FONT><FONT color=#0000ff size=2 face=Consolas><FONT color=#0000ff size=2 face=Consolas><FONT color=#0000ff size=2 face=Consolas>void</FONT></FONT></FONT><FONT size=2 face=Consolas><FONT size=2 face=Consolas> frmForm1_Load(</FONT></FONT><FONT color=#0000ff size=2 face=Consolas><FONT color=#0000ff size=2 face=Consolas><FONT color=#0000ff size=2 face=Consolas>object</FONT></FONT></FONT><FONT size=2 face=Consolas><FONT size=2 face=Consolas> sender, </FONT></FONT><FONT color=#2b91af size=2 face=Consolas><FONT color=#2b91af size=2 face=Consolas><FONT color=#2b91af size=2 face=Consolas>EventArgs</FONT></FONT></FONT><FONT size=2 face=Consolas><FONT size=2 face=Consolas> e)


    {


    </FONT></FONT> SheetView</FONT></FONT></FONT><FONT size=2 face=Consolas><FONT size=2 face=Consolas> oSheet = </FONT></FONT><FONT color=#0000ff size=2 face=Consolas><FONT color=#0000ff size=2 face=Consolas><FONT color=#0000ff size=2 face=Consolas>new</FONT></FONT></FONT><FONT size=2 face=Consolas><FONT size=2 face=Consolas> </FONT></FONT><FONT color=#2b91af size=2 face=Consolas><FONT color=#2b91af size=2 face=Consolas><FONT color=#2b91af size=2 face=Consolas>SheetView</FONT></FONT></FONT><FONT size=2 face=Consolas><FONT size=2 face=Consolas>();


    oSheet.ReferenceStyle = FarPoint.Win.Spread.Model.</FONT></FONT><FONT color=#2b91af size=2 face=Consolas><FONT color=#2b91af size=2 face=Consolas><FONT color=#2b91af size=2 face=Consolas>ReferenceStyle</FONT></FONT></FONT><FONT size=2 face=Consolas><FONT size=2 face=Consolas>.R1C1;


    oSheet.RowCount = 1;


    oSheet.ColumnCount = 1;


    oSheet.Cells[0, 0].Formula = </FONT></FONT><FONT color=#a31515 size=2 face=Consolas><FONT color=#a31515 size=2 face=Consolas><FONT color=#a31515 size=2 face=Consolas>"RSQ({0.044112796833773},{-0.008370832778813})"</FONT></FONT></FONT><FONT size=2 face=Consolas><FONT size=2 face=Consolas>;</FONT></FONT>


    <FONT size=2 face=Consolas><FONT size=2 face=Consolas>}

    </FONT></FONT>
  • Replied 8 September 2017, 2:50 pm EST

    Hello,

    I would like you to know that I was still not able to replicate the issue at my end. I still get the the same #DIV/0! error wherever I used this formula whether in the same sheet or on a different sheet in a different form. And this is the expected behavior as the formula is incorrect. I would request you to provide me a sample that depicts your issue so that I can debug it further.

    Thanks,

    Manpreet Kaur.

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels