==LINEST(known_ys, [known_xs], [const], [stats])
=LINEST({1.8;5.3;8.2;12;13.5},{1;3;5;7;8})
This example takes two sets of data and will return an array with two columns and one row containing the slope and the y-intercept of the regression line. The example will return an array of {1.6726,0.1317}. This means that the linear equation for the given data points is y = 1.6726x + 0.1317.
=LINEST({1.8;5.3;8.2;12;13.5},{1;3;5;7;8},TRUE,TRUE)
You can also use the LINEST function to return additional statistics by using additional parameters. The example will return an array of five rows and two columns equal to {1.6726,0.1317; 0.0371,0.2017; 0.9985,0.2124; 2034.443,3; 91.7567,0.1353}.
The LINEST function is used to calculate a straight line using the "least squares" method.