Calculates the statistics for a line by using the 'least squares' method to calculate a straight line that best fits your data.
Składnia
LINEST(known_ys, [known_xs], [const], [stats])Argumenty
known_yswymagane
The set of y-values already known in the relationship y = mx + b.
known_xsopcjonalne
An optional set of x-values that you may already know in the relationship y = mx + b.
constopcjonalne
A logical value specifying whether to force the constant b to equal 0.
statsopcjonalne
A logical value specifying whether to return additional regression statistics.
The LINEST function calculates the linear regression parameters for a set of data points. It returns an array of values describing the line, such as the slope and y-intercept, and can optionally provide additional regression statistics.
=LINEST({10,20,30}, {1,2,3})→{10, 0}Calculates the slope (10) and the y-intercept (0) for the given data points.
Select the output range
Highlight a range of cells where you want the regression results to appear.
Enter the formula
Type the LINEST formula and press Ctrl+Shift+Enter if you are using an older version of Excel.
If you are not using an array-enabled version of Excel, you must select the output range before entering the formula and press Ctrl+Shift+Enter.