{"id":16124,"date":"2023-08-01T12:30:15","date_gmt":"2023-08-01T12:30:15","guid":{"rendered":"https:\/\/officetuts.net\/excel\/?p=16124"},"modified":"2024-02-19T14:52:06","modified_gmt":"2024-02-19T14:52:06","slug":"using-the-linest-function","status":"publish","type":"post","link":"https:\/\/officetuts.net\/excel\/formulas\/using-the-linest-function\/","title":{"rendered":"Using the LINEST function"},"content":{"rendered":"\n
Using-the-LINEST-function<\/a>Download File<\/a><\/div>\n\n\n\n

A LINEST function<\/strong> is a great tool that can be used in Excel or Google Sheets. With this function, we can perform linear regression analysis<\/strong> and also calculate various statistics that relate to a linear trendline<\/strong> that fits the best to a given set of data points.<\/p>\n\n\n\n

This function will return the array of values<\/strong>. Each of these values presents different statistical information<\/strong>.<\/p>\n\n\n\n

In the example below, we will show how this function works and how to use it in the example.<\/p>\n\n\n\n

LINEST function explained<\/h2>\n\n\n\n

The syntax for the LINEST function is as follows:<\/p>\n\n\n\n

=LINEST(known_ys, [known_xs], [const], [stats])<\/code><\/pre>\n\n\n\n

The explanation of every parameter is as follows:<\/p>\n\n\n\n

    \n
  • Known_y\u2019s:<\/strong> This is a parameter that stores the array of a range of dependent variable data (Y-values)<\/strong> for which we aim to find the best-fit line. This parameter is mandatory<\/strong>.<\/li>\n\n\n\n
  • Known_x\u2019s:<\/strong> This parameter is optional and represents the array of a range of independent variable data (X-values)<\/strong>. If we do not provide it, the function will assume a series of sequential integers that will start from 1 as the X-values<\/strong>.<\/li>\n\n\n\n
  • Const: <\/strong>Another optional parameter specifies if we want to force the constant (Y-intercept)<\/strong> of the regression line through the origin (0)<\/strong>. If we use TRUE or 1<\/strong> we will define that the regression line will go through the origin. If we use FALSE or 0<\/strong>, the regression line will have a Y-intercept other than 0<\/strong>. If we do not insert any value, the default value is TRUE<\/strong>.<\/li>\n\n\n\n
  • Stats:<\/strong> Final optional argument which specifies if are there any additional statistics<\/strong> that can be included in the output. It is an array constant that we can use to extract the statistics like R-squared, standard errors, etc<\/strong>. If omitted, the function returns the slope and Y-intercept<\/strong> of the regression line.<\/li>\n<\/ul>\n\n\n\n

    To use the LINEST function<\/strong>, we need to keep in mind the following:<\/p>\n\n\n\n

      \n
    1. We need to organize your data and have a set of data pairs (X, Y)<\/strong> in the columns next to each other.<\/li>\n\n\n\n
    2. Our data ranges must be determined. Arrays for X-values and Y-values should<\/strong> be noted.<\/li>\n\n\n\n
    3. Only when the first two are met, we can enter the LINEST formula<\/strong>.<\/li>\n\n\n\n
    4. In the previous versions of Excel (versions older than Office 365 and non-online versions<\/strong>), we would need to press CTRL + SHIFT + ENTER<\/strong> to make this formula work, as it is an array formula. In newer versions, we do not have to do it.<\/li>\n<\/ol>\n\n\n\n

      How to use the LINEST function<\/h2>\n\n\n\n

      For our example, we will make a list of data, consisting of the grades of several students in Mathematics and History<\/strong>:<\/p>\n\n\n\n

      \"\"<\/figure>\n\n\n\n

      Our goal is to find the relationship between Math and History grades<\/strong> and to check if there is any linear correlation<\/strong> between the two.<\/p>\n\n\n\n

      To achieve this, we will first calculate the average<\/strong> for each student across the two subjects (this is an option step, but we do it to simplify the dataset)<\/strong>. For this, the new column Average<\/strong> will be added, and in that, the average of two grades will be calculated:<\/p>\n\n\n\n

      \"\"<\/figure>\n\n\n\n

      We will now use the LINEST function<\/strong> to perform the linear regression analysis and we will try to find the best-fit line<\/strong> for the relationship between Mathematics and History.<\/p>\n\n\n\n

      We will use the following formula and put it in cell E2<\/strong>:<\/p>\n\n\n\n

      =LINEST(C2:C6, B2:B6, TRUE, TRUE)<\/code><\/pre>\n\n\n\n

      and will get the following results:<\/p>\n\n\n\n

      \"\"<\/figure>\n\n\n\n

      In our formula, C2:C6<\/strong> are History grades (dependent variable)<\/strong> and range B2:B6<\/strong> represents the Mathematics grades (independent variable).<\/strong> Our third parameter will be TRUE<\/strong> to force the regression line through the origin (0)<\/strong>, as well as the fourth one to include additional statistics like R-squared<\/strong>.<\/p>\n\n\n\n

      Since we use the 365 Office version, we do not have to press CTRL+SHIFT+ENTER<\/strong> to make the formula work. In older Office versions, we would have to do it.<\/p>\n\n\n\n

      The results that we got are an array containing the slope, Y-intercept, standard error of slope, standard error of Y-intercept, R-squared, and other requested statistics<\/strong>:<\/p>\n\n\n\n

      \"\"<\/figure>\n\n\n\n

      Looking at the column E<\/strong>, explanations are as follows:<\/p>\n\n\n\n

        \n
      • The Slope represents the change<\/strong> in the History grade for a one-unit increase<\/strong> in the Mathematics grade.<\/li>\n\n\n\n
      • Y-intercept<\/strong> gives us the expected History grade<\/strong> when the Mathematics grade is<\/strong> 0 (this one is not practical in our example).<\/li>\n\n\n\n
      • The R-squared value<\/strong> shows how well the linear regression line fits the data<\/strong> (higher values indicate a better fit).<\/li>\n<\/ul>\n\n\n\n

        The LINEST function<\/strong> in this example is used for a simple linear regression analysis<\/strong> that only has two variables<\/strong>. If you have more complex scenarios, you should consider multiple regression analysis or some other statistical methods.<\/p>\n","protected":false},"excerpt":{"rendered":"

        A LINEST function is a great tool that can be used in Excel or Google Sheets. With this function, we can perform linear…<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[23],"tags":[170],"yoast_head":"\nUsing the LINEST function<\/title>\n<meta name=\"description\" content=\"Download the Using-the-LINEST-function file and learn how to perform linear regression analysis and calculate statistical information in Excel or Google Sheets.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/officetuts.net\/excel\/formulas\/using-the-linest-function\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Using the LINEST function\" \/>\n<meta property=\"og:description\" content=\"Download the Using-the-LINEST-function file and learn how to perform linear regression analysis and calculate statistical information in Excel or Google Sheets.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/officetuts.net\/excel\/formulas\/using-the-linest-function\/\" \/>\n<meta property=\"article:published_time\" content=\"2023-08-01T12:30:15+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-02-19T14:52:06+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/officetuts.net\/excel\/wp-content\/uploads\/sites\/2\/2023\/08\/word-image-16124-1.png\" \/>\n<meta name=\"author\" content=\"Harun Spahic\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Harun Spahic\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/officetuts.net\/excel\/formulas\/using-the-linest-function\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/officetuts.net\/excel\/formulas\/using-the-linest-function\/\"},\"author\":{\"name\":\"Harun Spahic\",\"@id\":\"https:\/\/officetuts.net\/excel\/#\/schema\/person\/694491c70f776081acdac4ae41f222a2\"},\"headline\":\"Using the LINEST function\",\"datePublished\":\"2023-08-01T12:30:15+00:00\",\"dateModified\":\"2024-02-19T14:52:06+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/officetuts.net\/excel\/formulas\/using-the-linest-function\/\"},\"wordCount\":748,\"publisher\":{\"@id\":\"https:\/\/officetuts.net\/excel\/#\/schema\/person\/41b0b6996aaa4c4127f86f3d24452d42\"},\"image\":{\"@id\":\"https:\/\/officetuts.net\/excel\/formulas\/using-the-linest-function\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/officetuts.net\/excel\/wp-content\/uploads\/sites\/2\/2023\/08\/word-image-16124-1.png\",\"keywords\":[\"file\"],\"articleSection\":[\"formulas\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/officetuts.net\/excel\/formulas\/using-the-linest-function\/\",\"url\":\"https:\/\/officetuts.net\/excel\/formulas\/using-the-linest-function\/\",\"name\":\"Using the LINEST function\",\"isPartOf\":{\"@id\":\"https:\/\/officetuts.net\/excel\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/officetuts.net\/excel\/formulas\/using-the-linest-function\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/officetuts.net\/excel\/formulas\/using-the-linest-function\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/officetuts.net\/excel\/wp-content\/uploads\/sites\/2\/2023\/08\/word-image-16124-1.png\",\"datePublished\":\"2023-08-01T12:30:15+00:00\",\"dateModified\":\"2024-02-19T14:52:06+00:00\",\"description\":\"Download the Using-the-LINEST-function file and learn how to perform linear regression analysis and calculate statistical information in Excel or Google Sheets.\",\"breadcrumb\":{\"@id\":\"https:\/\/officetuts.net\/excel\/formulas\/using-the-linest-function\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/officetuts.net\/excel\/formulas\/using-the-linest-function\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/officetuts.net\/excel\/formulas\/using-the-linest-function\/#primaryimage\",\"url\":\"https:\/\/officetuts.net\/excel\/wp-content\/uploads\/sites\/2\/2023\/08\/word-image-16124-1.png\",\"contentUrl\":\"https:\/\/officetuts.net\/excel\/wp-content\/uploads\/sites\/2\/2023\/08\/word-image-16124-1.png\",\"width\":344,\"height\":174},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/officetuts.net\/excel\/formulas\/using-the-linest-function\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/officetuts.net\/excel\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Using the LINEST function\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/officetuts.net\/excel\/#website\",\"url\":\"https:\/\/officetuts.net\/excel\/\",\"name\":\"\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/officetuts.net\/excel\/#\/schema\/person\/41b0b6996aaa4c4127f86f3d24452d42\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/officetuts.net\/excel\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/officetuts.net\/excel\/#\/schema\/person\/41b0b6996aaa4c4127f86f3d24452d42\",\"name\":\"Tomasz Decker\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/officetuts.net\/excel\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/18cbe22837193574870ae40ba56bf712?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/18cbe22837193574870ae40ba56bf712?s=96&d=mm&r=g\",\"caption\":\"Tomasz Decker\"},\"logo\":{\"@id\":\"https:\/\/officetuts.net\/excel\/#\/schema\/person\/image\/\"},\"description\":\"Spreadsheet and Python enthusiast.\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/officetuts.net\/excel\/#\/schema\/person\/694491c70f776081acdac4ae41f222a2\",\"name\":\"Harun Spahic\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/officetuts.net\/excel\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/b7b887a2249679182be5550a4421a7a9?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/b7b887a2249679182be5550a4421a7a9?s=96&d=mm&r=g\",\"caption\":\"Harun Spahic\"},\"sameAs\":[\"http:\/\/human.bsru.ac.th\/\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Using the LINEST function","description":"Download the Using-the-LINEST-function file and learn how to perform linear regression analysis and calculate statistical information in Excel or Google Sheets.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/officetuts.net\/excel\/formulas\/using-the-linest-function\/","og_locale":"en_US","og_type":"article","og_title":"Using the LINEST function","og_description":"Download the Using-the-LINEST-function file and learn how to perform linear regression analysis and calculate statistical information in Excel or Google Sheets.","og_url":"https:\/\/officetuts.net\/excel\/formulas\/using-the-linest-function\/","article_published_time":"2023-08-01T12:30:15+00:00","article_modified_time":"2024-02-19T14:52:06+00:00","og_image":[{"url":"https:\/\/officetuts.net\/excel\/wp-content\/uploads\/sites\/2\/2023\/08\/word-image-16124-1.png"}],"author":"Harun Spahic","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Harun Spahic","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/officetuts.net\/excel\/formulas\/using-the-linest-function\/#article","isPartOf":{"@id":"https:\/\/officetuts.net\/excel\/formulas\/using-the-linest-function\/"},"author":{"name":"Harun Spahic","@id":"https:\/\/officetuts.net\/excel\/#\/schema\/person\/694491c70f776081acdac4ae41f222a2"},"headline":"Using the LINEST function","datePublished":"2023-08-01T12:30:15+00:00","dateModified":"2024-02-19T14:52:06+00:00","mainEntityOfPage":{"@id":"https:\/\/officetuts.net\/excel\/formulas\/using-the-linest-function\/"},"wordCount":748,"publisher":{"@id":"https:\/\/officetuts.net\/excel\/#\/schema\/person\/41b0b6996aaa4c4127f86f3d24452d42"},"image":{"@id":"https:\/\/officetuts.net\/excel\/formulas\/using-the-linest-function\/#primaryimage"},"thumbnailUrl":"https:\/\/officetuts.net\/excel\/wp-content\/uploads\/sites\/2\/2023\/08\/word-image-16124-1.png","keywords":["file"],"articleSection":["formulas"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/officetuts.net\/excel\/formulas\/using-the-linest-function\/","url":"https:\/\/officetuts.net\/excel\/formulas\/using-the-linest-function\/","name":"Using the LINEST function","isPartOf":{"@id":"https:\/\/officetuts.net\/excel\/#website"},"primaryImageOfPage":{"@id":"https:\/\/officetuts.net\/excel\/formulas\/using-the-linest-function\/#primaryimage"},"image":{"@id":"https:\/\/officetuts.net\/excel\/formulas\/using-the-linest-function\/#primaryimage"},"thumbnailUrl":"https:\/\/officetuts.net\/excel\/wp-content\/uploads\/sites\/2\/2023\/08\/word-image-16124-1.png","datePublished":"2023-08-01T12:30:15+00:00","dateModified":"2024-02-19T14:52:06+00:00","description":"Download the Using-the-LINEST-function file and learn how to perform linear regression analysis and calculate statistical information in Excel or Google Sheets.","breadcrumb":{"@id":"https:\/\/officetuts.net\/excel\/formulas\/using-the-linest-function\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/officetuts.net\/excel\/formulas\/using-the-linest-function\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/officetuts.net\/excel\/formulas\/using-the-linest-function\/#primaryimage","url":"https:\/\/officetuts.net\/excel\/wp-content\/uploads\/sites\/2\/2023\/08\/word-image-16124-1.png","contentUrl":"https:\/\/officetuts.net\/excel\/wp-content\/uploads\/sites\/2\/2023\/08\/word-image-16124-1.png","width":344,"height":174},{"@type":"BreadcrumbList","@id":"https:\/\/officetuts.net\/excel\/formulas\/using-the-linest-function\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/officetuts.net\/excel\/"},{"@type":"ListItem","position":2,"name":"Using the LINEST function"}]},{"@type":"WebSite","@id":"https:\/\/officetuts.net\/excel\/#website","url":"https:\/\/officetuts.net\/excel\/","name":"","description":"","publisher":{"@id":"https:\/\/officetuts.net\/excel\/#\/schema\/person\/41b0b6996aaa4c4127f86f3d24452d42"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/officetuts.net\/excel\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/officetuts.net\/excel\/#\/schema\/person\/41b0b6996aaa4c4127f86f3d24452d42","name":"Tomasz Decker","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/officetuts.net\/excel\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/18cbe22837193574870ae40ba56bf712?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/18cbe22837193574870ae40ba56bf712?s=96&d=mm&r=g","caption":"Tomasz Decker"},"logo":{"@id":"https:\/\/officetuts.net\/excel\/#\/schema\/person\/image\/"},"description":"Spreadsheet and Python enthusiast."},{"@type":"Person","@id":"https:\/\/officetuts.net\/excel\/#\/schema\/person\/694491c70f776081acdac4ae41f222a2","name":"Harun Spahic","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/officetuts.net\/excel\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/b7b887a2249679182be5550a4421a7a9?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/b7b887a2249679182be5550a4421a7a9?s=96&d=mm&r=g","caption":"Harun Spahic"},"sameAs":["http:\/\/human.bsru.ac.th\/"]}]}},"_links":{"self":[{"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/posts\/16124"}],"collection":[{"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/comments?post=16124"}],"version-history":[{"count":3,"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/posts\/16124\/revisions"}],"predecessor-version":[{"id":16132,"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/posts\/16124\/revisions\/16132"}],"wp:attachment":[{"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/media?parent=16124"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/categories?post=16124"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/officetuts.net\/excel\/wp-json\/wp\/v2\/tags?post=16124"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}