Microsoft KB Archive/214230

= Incorrect output is returned when you use the Linear Regression (LINEST) function in Excel =

Article ID: 214230

Article Last Modified on 2/14/2007

-

APPLIES TO


 * Microsoft Office Excel 2003
 * Microsoft Excel 2002 Standard Edition
 * Microsoft Excel 2000 Standard Edition
 * Microsoft Excel 97 Standard Edition
 * Microsoft Excel 2004 for Mac
 * Microsoft Excel X for Mac
 * Microsoft Excel 2001 for Mac
 * Microsoft Excel 98 for Macintosh
 * Microsoft Office Excel 2007

-



This article was previously published under Q214230





SYMPTOMS
When you use the LINEST worksheet function in a worksheet, the statistical output may return incorrect values. The Regression tool in the Analysis ToolPak may also return incorrect values.



CAUSE
The output returned from LINEST may be incorrect if one or more of the following conditions are true:
 * The range of x-values overlaps the range of y-values.
 * The number of rows in the input range is less than the number of columns in the total range (x-value plus y-value).
 * You specify a zero constant (set the third argument of the LINEST function to True).



Case 1: The X-value and Y-value Ranges Overlap
If the x-value and y-value ranges overlap, the LINEST worksheet function produces incorrect values in all result cells. Normal statistical probability disallows the values in the x and y ranges to overlap (duplicate each other). Do not overlap the x- and y-value ranges when referencing cells in the formula.

NOTE: The Regression tool alerts you to this problem and does not continue. You can use the Regression tool instead of the LINEST worksheet function.

In Excel 2007, you can find the Regression tool by clicking Data Analysis in the Analysis group on the Data tab.

In Excel 2003 and earlier versions of Excel, you can find the Regression tool by clicking Data Analysis on the Tools menu.

Case 2: The Number of Rows Is Less Than the Number of X-columns
It is not statistically valid for the number of rows to be less than the number of x (variable) columns. The number of rows of data must be larger than the number of columns of data (x-columns plus y-columns).

Case 3: You Specify a Zero Constant
Do not specify a zero constant (b=0) in the function.



MORE INFORMATION
The Regression tool is included in the Analysis ToolPak. The Analysis ToolPak is a Microsoft Office Excel add-in program. It is available when you install Microsoft Office or Microsoft Office Excel. Before you use the Regression tool in Excel, you have to load the Analysis ToolPak.

To do this in Excel 2007, follow these steps:
 * 1) Click the Microsoft Office Button, and then click Excel Options.
 * 2) Click Add-Ins, and then select Excel Add-ins in the Manage box.
 * 3) Click Go.
 * 4) In the Add-Ins available box, click to select the Analysis ToolPak check box, and then click OK.

Note If Analysis ToolPak is not listed in the Add-Ins available box, click Browse to locate it.

To do this in Excel 2003 and earlier versions of Excel, follow these steps:
 * 1) On the Tools menu, click Add-Ins.
 * 2) In the Add-Ins box, click to select the Analysis ToolPak, and then click OK,

Note If Analysis ToolPak is not listed in the Add-Ins available box, click Browse to locate it.

