LINEST
The LINEST function in Google Sheets is a powerful tool for calculating various parameters about the ideal linear trend using the least-squares method. It is used to determine the equation of a straight line that best fits a given set of data points. Dive into our comprehensive guide to master its application.
Function Syntax and Parameters
Syntax: LINEST(known_data_y, [known_data_x], [calculate_b], [verbose])
Parameters:
known_data_y: The array or range containing the dependent variable data.known_data_x: [Optional] The array or range containing the independent variable data.calculate_b: [Optional] A logical value indicating whether to calculate the slope parameterb. Default istrue.verbose: [Optional] A logical value indicating whether to return additional regression statistics. Default isfalse.
Step-by-Step Tutorial
-
Using
LINESTwith known data points:- Example:
=LINEST(A2:A6, B2:B6) - Result:
{0.25, 0.05}
- Example:
-
Using
LINESTwith known data points and calculating additional regression statistics:- Example:
=LINEST(A2:A6, B2:B6, true, true) - Result:
{0.25, 0.05, 0.99, 0.98}
- Example:
Use Cases and Scenarios
- Sales Analysis: Determine the trend and rate of change for sales data.
- Stock Market Analysis: Calculate the slope of a stock's price over time.
- Forecasting: Predict future values based on historical data.
Related Functions
SLOPE: Calculate the slope of a linear regression line.INTERCEPT: Calculate the y-intercept of a linear regression line.