How to use LINEST function in Excel - formula examples

Svetlana Cheusheva

by Svetlana Cheusheva , updated on March 16, 2023

This tutorial explains the syntax of the LINEST function and shows how to use it to do linear regression analysis in Excel.

Microsoft Excel is not a statistical program, however, it does have a number of statistical functions. One of such functions is LINEST, which is designed to perform linear regression analysis and return related statistics. In this tutorial for beginners, we will touch only lightly on theory and underlying calculations. Our main focus will be on providing you with a formula that simply works and can be easily customized for your data.

Excel LINEST function - syntax and basic uses

The LINEST function calculates the statistics for a straight line that explains the relationship between the independent variable and one or more dependent variables, and returns an array describing the line. The function uses the least squares method to find the best fit for your data. The equation for the line is as follows.

Simple linear regression equation:

Multiple regression equation:

y = b1x1 + b2x2 + … + bnxn + a

In its basic form, the LINEST function returns the intercept (a) and the slope (b) for the regression equation. Optionally, it can also return additional statistics for the regression analysis as shown in this example.

LINEST function syntax

The syntax of the Excel LINEST function is as follows:

LINEST(known_y's, [known_x's], [const], [stats])