+ Reply to Thread
Results 1 to 6 of 6

Linest: return intercept only

  1. #1
    Registered User
    Join Date
    04-22-2015
    Location
    Amsterdam, the Netherlands
    MS-Off Ver
    2010
    Posts
    7

    Linest: return intercept only

    Hey guys, I'm using the Linest function, looking something like this: =LINEST(B98:B133,NQ98:NT133,TRUE). So, excel performs a straight-line regression, with known y's in B98:B133 and known y's in NQ98:NT133. Note that I include an intercept (aka constant or alpha), hence the 'TRUE', and that I have 4 variables (in column NQ, NR, NS and NT). I press CTRL + SHIFT + ENTER, and presto, in the first four cells my regression factors are returned, and my intercept is returned in the fifth cell. So far so good.

    Problem is, I'm only interested in the intercept, thus, the fifth cell. Just ignore the first four you might say, but I've got a huge matrix of data, so I want to autofill this formula both down as right. Especially autofilling to the right will give me problems. So in my formula bar, I need to add something so that only my fifth value of the array is returned. An alternative is a formula that "mirrors" my array, so that the fifth return becomes the first, the fourth becomes the second etc.

    Anyone any thoughts on this? Thanks!

  2. #2
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Linest: return intercept only

    Although I am not familiair with the formula linest,


    1. It would help to see the workbook.

    You get better help on your question if you add a small excel file, without confidential information.

    Please also add manualy the expected result in your file.

    To Attach a File:

    1. Scroll down to the window below your post Additional Options
    2. In the frame Attach Files you will see the button Manage Attachments
    3. Click the button.
    4. A new window will open titled Manage Attachments - Excel Forum.
    5. Click the Browse... button to locate your file for uploading.
    6. This will open a new window File Upload.
    7. Once you have located the file to upload click the Open button. This window will close.
    8. You are now back in the Manage Attachments - Excel Forum window.
    9. Click the Upload button and wait until the file has uploaded.
    10. Close the window and then click Submit.
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  3. #3
    Forum Expert Crooza's Avatar
    Join Date
    10-19-2013
    Location
    Hunter Valley, Australia
    MS-Off Ver
    Excel 2003 /7/10
    Posts
    2,082

    Re: Linest: return intercept only

    If you're not interested in the first four cells - the coefficients - then you can just use the intercept function to get the fifth cell only.

    It's in the form of = intercept(known y, known x)
    Happy with my advice? Click on the * reputation button below

  4. #4
    Registered User
    Join Date
    04-22-2015
    Location
    Amsterdam, the Netherlands
    MS-Off Ver
    2010
    Posts
    7

    Re: Linest: return intercept only

    Hi Oelderen, thanks for your reply, but I think I found the answer myself already . Adding an index function allows me to choose which cell in my array I want to have returned. So, in the example of my opening post, this would be =INDEX(LINEST(B98:B133,NQ98:NT133,TRUE),1,5).

    So, linest returns an array with 1 row and 5 columns, of which I am only interested in the fifth column (in my case you can replace the word column by cell). That is what the index function does: returning row 1, column 5. Sorted!

    Sorry for posting, but hopefully this posts helps other people in the future.

  5. #5
    Registered User
    Join Date
    04-22-2015
    Location
    Amsterdam, the Netherlands
    MS-Off Ver
    2010
    Posts
    7

    Re: Linest: return intercept only

    Also Crooza thanks, but the intercept function only works with 1 independent variable. If you have more, like I do (four), then intercept doesn't work...

  6. #6
    Forum Expert Crooza's Avatar
    Join Date
    10-19-2013
    Location
    Hunter Valley, Australia
    MS-Off Ver
    Excel 2003 /7/10
    Posts
    2,082

    Re: Linest: return intercept only

    Quote Originally Posted by Tim89 View Post
    Also Crooza thanks, but the intercept function only works with 1 independent variable. If you have more, like I do (four), then intercept doesn't work...
    Got it. And yes your method of using the index to get the 5th value should work nicely.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [linest] Whu LINEST can't the precise parameter of each variable?
    By valuex in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-19-2015, 12:12 PM
  2. How do I get linest and intercept to ignore blank cells?
    By KernalKip in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-07-2015, 06:01 AM
  3. Replies: 5
    Last Post: 10-12-2014, 04:26 PM
  4. [SOLVED] Negative Return on Slope/Intercept when Trending Downwards
    By Shotlod in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 07-06-2014, 03:59 AM
  5. [SOLVED] Linest Function - Unable to get LinEst property of the WorksheetFunction class
    By fbs13 in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 07-25-2013, 09:55 AM
  6. Weighted/Conditional LINEST VBA (Coefficient/Y-Intercept)
    By rylock in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 02-19-2013, 11:51 AM
  7. Intercept and Linest functions.
    By Thorxes in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 11-29-2008, 02:36 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1