![microsoft excel 2011 how to find slope microsoft excel 2011 how to find slope](https://i.ytimg.com/vi/6Zv_CbBKcao/maxresdefault.jpg)
PS: also it would be a good thing if you answer people talking to you. But, please, in the future provide much better information as far as what D Stanley did was basically a lucky guess (there wasn't enough information in your question to even know what you wanted for sure). Also you can take a look at the "Edited X mins ago" link above. D Stanley would you please tell me what did you change since the first post? Thank you! – Eddie Nov 14 '13 at you don't need to write when you are in the answer of the given user.
#MICROSOFT EXCEL 2011 HOW TO FIND SLOPE CODE#
I think Stanley just edited his code above and it works now. Perhaps it is a rounding problem as far as lots of operations are involved. – Eddie Nov 14 '13 at can you please provide a way to validate your calculations as suggested via comments? For example 3/4 cases. int go_back in most cases would be 0 by definition, but I use it to deal with Year-To-Date situation in other functions. int months in my code is the number of data within each list. Nov 14 '13 at Stanley, your code get 2.11 which is 1/0.47. ) ĭouble slope = xys.Sum(xy => (xy.x - xbar) * (xy.y - ybar)) / xs.Sum(x => (x - xbar)*(x - xbar)) Return slope = 1 / (((sumxy - sumx * sumy / months) / (sumx2 - sumx * sumx / months))) Sumx2 += ProductGrossExcessReturnOverRFR * ProductGrossExcessReturnOverRFR Sumxy += ProductGrossExcessReturnOverRFR * primaryInde圎xcessReturnOverRFR Private double Getslope(List ProductGrossExcessReturnOverRFR, List primaryInde圎xcessReturnOverRFR, int months, int go_back = 0)ĭouble sumx = 0, sumy = 0, sumxy = 0, sumx2 = 0 įor (int i = ProductGrossExcessReturnOverRFR.Count - 1 - go_back i > ProductGrossExcessReturnOverRFR.Count - (1 + months + go_back) i-) Here is my code, it can calculate something, but not the correct number that you would get from the Excel function. I'm trying to mimic this function in C# WinForm. You can easily calculate this in EXCEL using the SLOPE function. I'm trying to calculate the slope of two data lists.