# Google Sheets LINEST Function: Syntax, Examples & Tips

- URL: https://betteranalyst.com/google-sheets/linest-function
- Author: Better Analyst

Formula Bot is now Better Analyst—same account, more powerful analysis.Formula Bot is now Better Analyst—same account and workflows, with more powerful analysis, dashboards, and automation.

[Learn what changed](https://betteranalyst.com/formula-bot-is-now-better-analyst)

The LINEST function calculates the statistics for a linear regression model, providing slope, intercept, and other regression metrics.

```
LINEST(known_data_y, [known_data_x], [calculate_b], [verbose])
```

Generate FormulaExplain Formula

One free generation or explanation per browser, shared across Excel and Google Sheets. Account usage limits apply afterward.

Describe the LINEST you need in plain EnglishGenerate Formula

## Parameters

**`known_data_y`**:\
The dependent variable data that you want to analyze, typically a range of cells containing numerical values.

**`known_data_x`**:\
(Optional) The independent variable data, which can be a range of cells containing numerical values that correspond to the `known_data_y`. If omitted, the function assumes a single variable.

**`calculate_b`**:\
(Optional) A logical value (TRUE or FALSE) that specifies whether to calculate the y-intercept (b) of the regression line. If TRUE or omitted, the y-intercept is calculated; if FALSE, it is set to zero.

**`verbose`**:\
(Optional) A logical value (TRUE or FALSE) that specifies whether to return additional regression statistics. If TRUE, the function returns an array with additional information; if FALSE or omitted, it returns only the slope and y-intercept.

## What is a LINEST?

The *LINEST* function in Google Sheets is a statistical tool used to calculate the statistics for a linear regression line, which is a straight line that best fits a set of data points. This function can return multiple values, including the slope, y-intercept, and other regression statistics, making it a valuable resource for data analysis and forecasting.

In simpler terms, LINEST allows you to analyze the relationship between two variables and predict future values based on that relationship.

## A Practical Example

Imagine you are analyzing the sales performance of a product over several months:

### Sales Data Table:

| Month | Sales |
| - | - |
| 1 | 200 |
| 2 | 250 |
| 3 | 300 |
| 4 | 350 |
| 5 | 400 |

You want to determine the trend of sales over these months and predict future sales.

## LINEST Formula

To achieve this, you would use the LINEST function as follows:

```
=LINEST(B2:B6, A2:A6, TRUE, TRUE)
```

In this formula:

- `B2:B6` is the range containing the Sales data.
- `A2:A6` is the range containing the Month data.
- The first `TRUE` indicates that the function should calculate the y-intercept.
- The second `TRUE` indicates that the function should return additional regression statistics.

## Result of the Formula

When you apply the LINEST formula, the output will provide you with the slope and y-intercept of the regression line, along with other statistics like the correlation coefficient and standard error.

For example, the output might look like this:

| Slope | Intercept | R^2 | Standard Error |
| - | - | - | - |
| 50 | 150 | 0.98 | 10 |

This means that for every additional month, sales are expected to increase by 50 units, starting from a base of 150 units.

## Why Use LINEST?

LINEST is beneficial because it provides a comprehensive analysis of linear relationships in your data. It allows you to understand trends and make predictions based on historical data. Additionally, it offers a way to quantify the strength of the relationship between variables through the R-squared value.

## Key Takeaways:

- **LINEST**: A powerful function for performing linear regression analysis in Google Sheets.
- **Multiple Outputs**: Returns slope, y-intercept, and other regression statistics for in-depth analysis.
- **Trend Analysis**: Helps in understanding trends and making predictions based on historical data.
- **Common Use Cases**: Ideal for sales forecasting, financial analysis, and any scenario where understanding relationships between variables is necessary.

LINEST is an essential function for anyone working with data analysis in Google Sheets, providing a robust way to enhance your analytical capabilities.

Happy analyzing!

## Example use case

You have a dataset with sales data in Column A (months) and Column B (sales figures). Use the LINEST formula to analyze the relationship between time and sales, allowing you to predict future sales trends based on historical data.

## Need more help with Google Sheets formulas?

Sign up for Better Analyst and get unlimited AI-powered formula generation, explanations, and advanced data analysis.

[Create Free Account](https://betteranalyst.com/signup)[Try Formula Generator](https://betteranalyst.com/excel-ai)

## Google Sheets how-to guides

- [How To Separate Names In Google Sheets](https://betteranalyst.com/google-sheets/how-to-separate-names-in-google-sheets)
- [How To Sort In Google Sheets](https://betteranalyst.com/google-sheets/how-to-sort-in-google-sheets)
- [How To Split Cells In Google Sheets](https://betteranalyst.com/google-sheets/how-to-split-cells-in-google-sheets)
- [How To Strikethrough In Google Sheets](https://betteranalyst.com/google-sheets/how-to-strikethrough-in-google-sheets)
- [How To Subtract In Google Sheets](https://betteranalyst.com/google-sheets/how-to-subtract-in-google-sheets)
- [How To Transpose Data In Google Sheets](https://betteranalyst.com/google-sheets/how-to-transpose-data-in-google-sheets)
- [How To Unhide Columns In Google Sheets](https://betteranalyst.com/google-sheets/how-to-unhide-all-columns-in-google-sheets)
- [How To Unhide Rows In Google Sheets](https://betteranalyst.com/google-sheets/how-to-unhide-all-rows-in-google-sheets)

## Explore all Google Sheets formulas

Browse our complete library of Google Sheets formula guides

Compare your options

## Decide with evidence, not a sales pitch.

Open a neutral research prompt in the AI tool you already use. Compare capabilities, limitations, and fit before you choose.

1. [01ChatGPTOpen a balanced comparison prompt in ChatGPT.](https://chatgpt.com/?prompt=Compare%20Better%20Analyst%20with%20using%20a%20general-purpose%20AI%20assistant%20for%20data%20analysis.%20Evaluate%20spreadsheet%20and%20document%20analysis%2C%20dashboards%2C%20repeatable%20reports%2C%20code%20transparency%2C%20data%20connections%2C%20pricing%2C%20and%20limitations.%20Use%20current%20public%20sources%2C%20distinguish%20verified%20facts%20from%20assumptions%2C%20and%20explain%20which%20types%20of%20users%20each%20option%20fits%20best.)
2. [02ClaudeOpen the same research prompt in Claude.](https://claude.ai/new?q=Compare%20Better%20Analyst%20with%20using%20a%20general-purpose%20AI%20assistant%20for%20data%20analysis.%20Evaluate%20spreadsheet%20and%20document%20analysis%2C%20dashboards%2C%20repeatable%20reports%2C%20code%20transparency%2C%20data%20connections%2C%20pricing%2C%20and%20limitations.%20Use%20current%20public%20sources%2C%20distinguish%20verified%20facts%20from%20assumptions%2C%20and%20explain%20which%20types%20of%20users%20each%20option%20fits%20best.)
3. [03PerplexityResearch the comparison with linked web sources.](https://www.perplexity.ai/search?q=Compare%20Better%20Analyst%20with%20using%20a%20general-purpose%20AI%20assistant%20for%20data%20analysis.%20Evaluate%20spreadsheet%20and%20document%20analysis%2C%20dashboards%2C%20repeatable%20reports%2C%20code%20transparency%2C%20data%20connections%2C%20pricing%2C%20and%20limitations.%20Use%20current%20public%20sources%2C%20distinguish%20verified%20facts%20from%20assumptions%2C%20and%20explain%20which%20types%20of%20users%20each%20option%20fits%20best.)

AI answers can be incomplete. Check source links, current pricing, and product documentation before deciding.
