Something along the lines of Sub testIt() Dim x As Variant, y As Variant, rslt As Variant, i As Long ReDim x(1 To 10, 1 To 2) ReDim y(1 To 10, 1 To 1) For i = 1 To 10 x(i, 1) = CDbl(i): x(i, 2) = i ^ 2 y(i, 1) = x(i, 1) + x(i, 2) + Rnd() - 0.5 Next i rslt = Application.WorksheetFunction.LinEst(y, x, True, True) End Sub rslt will be a multi-dimensional array (5 x 3) very much like the result of LINEST in a worksheet. -- Regards, Tushar Mehta, MS MVP -- Excel Excel, PowerPoint, and VBA add-ins, tutorials Custom MS Office productivity solutions. Something along the lines of Sub testIt() Dim x As Variant, y As Variant, rslt As Variant, i As Long ReDim x(1 To 10, 1 To 2) ReDim y(1 To 10, 1 To 1) For i = 1 To 10 x(i, 1) = CDbl(i): x(i, 2) = i ^ 2 y(i, 1) = x(i, 1) + x(i, 2) + Rnd() - 0.5 Next i rslt = Application.WorksheetFunction.LinEst(y, x, True, True) End Sub rslt will be a multi-dimensional array (5 x 3) very much like the result of LINEST in a worksheet. -- Regards, Tushar Mehta, MS MVP -- Excel Excel, PowerPoint, and VBA add-ins, tutorials Custom MS Office productivity solutions. LINEST function is a built on function in excel which comes under the category of Statistical function which uses “LEAST SQUARES” method to find the line of ex act fit through a set of array values i.e x and y values. Guide to LINEST Function in Excel. Iru malargal serial zee. Bhaag milkha bhaag movie download filmyzilla. Here we discuss the LINEST Formula and how to use LINEST in excel along with excel example and downloadable excel. ![]() A comment on asked if it was possible to use the function on data with gaps. There are several options: • Copy and sort the data to remove the gaps. • Use the chart trendline function • Use one of the on-sheet functions provided by Lori Miller in a reply to the comment. • Use the LinEstgap() User Defined Function (UDF) that has been added to the Linest-poly spreadsheet. A copy of linest-poly, including full open source code, may be downloaded from:. ![]() Both the on-sheet functions and the LinEstGap() function must be entered as an array function, as described here: Use of these options (other than number 1) is shown in the screen-shots below: With continuous data all options give the same result.
0 Comments
Leave a Reply. |