<< Go back to all functions

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 parameter b. Default is true.
  • verbose: [Optional] A logical value indicating whether to return additional regression statistics. Default is false.

Step-by-Step Tutorial

  1. Using LINEST with known data points:

    • Example: =LINEST(A2:A6, B2:B6)
    • Result: {0.25, 0.05}
  2. Using LINEST with 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}

Use Cases and Scenarios

  1. Sales Analysis: Determine the trend and rate of change for sales data.
  2. Stock Market Analysis: Calculate the slope of a stock's price over time.
  3. 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.

Related Articles