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 #DIV/0!


    ii) R Squared formula used in Form2


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


    and the output is 7.17230609057783


     


    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


    using FarPoint.Win.Spread.Model;


    using FarPoint.Win.Spread.DrawingSpace;


    using FarPoint.Win;


    using FarPoint.Win.Spread;


    using FarPoint.Win.Spread.CellType;


    public void frmForm1_Load(object sender, EventArgs e)


    {


     SheetView oSheet = new SheetView();


    oSheet.ReferenceStyle = FarPoint.Win.Spread.Model.ReferenceStyle.R1C1;


    oSheet.RowCount = 1;


    oSheet.ColumnCount = 1;


    oSheet.Cells[0, 0].Formula = "RSQ({0.044112796833773},{-0.008370832778813})";


    }

  • 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