LINEST

Given partial data about a linear trend, calculates various parameters about the ideal linear trend using the least-squares method. Learn more

Video field
Array

The LINEST function in Google Sheets is a powerful tool for analyzing trends and making predictions based on a set of data points. Here's an example of how it works:

Suppose you have a set of data that shows the number of hours studied and the corresponding test scores for a group of students. You want to determine the relationship between the two variables and predict the test score for a given number of study hours.

And let's say the value of "Test Score" column for 2 "Hours Studied" is 60, for 3 it is 75, for 4 it is 83, for 5 it is 92, and for 6 the value is 100.

To use the LINEST function to calculate the slope and y-intercept of the best-fit line for this data, follow these steps:

  1. Enter the data into a spreadsheet, with the hours studied in column A and the corresponding test scores in column B.
  2. In an empty cell, enter the formula "=LINEST(B2:B6,A2:A6,TRUE,TRUE)" and press enter.
  3. The function will return an array of values, including the slope and y-intercept of the best-fit line.

In this example, the LINEST function will return a slope of approximately 14.6 and a y-intercept of approximately 36.5. This means that, on average, for every additional hour of study time, the test score is expected to increase by 14.6 points. You can use this information to predict the test score for any given number of study hours.

Want even more from Google Sheets?


With Softr, you can turn your spreadsheets into powerful web apps.You can give advanced roles and permissions to each user, build advanced logic and automation flows, customize the design to your needs, and much more.


Softr also offers a growing library of templates for internal tools, client portals, community hubs, and more. The templates come with a Google Sheet or an Airtable base that you can use to store and manage your data easily.


Try Softr now and build your custom web apps in 10 minutes no code required!