+ Reply to Thread
Results 1 to 7 of 7

2nd Polynomial Trendline prediction

  1. #1
    Registered User
    Join Date
    03-19-2013
    Location
    Somerset, UK.
    MS-Off Ver
    Excel 2010
    Posts
    16

    2nd Polynomial Trendline prediction

    I've got a record of Heating Oil usage and I'm trying to extrapolate the date when it predicts I'll run out. I'm using a 2nd order Polynomial because it best matches the consumption line.
    Oil Usage 1.xlsx

    I'm trying to use the LINEST function to do this.
    I tried
    Please Login or Register  to view this content.
    but it won't let me include "#N/A" cells.

    I tried
    Please Login or Register  to view this content.
    but it also won't let me include "#N/A" cells.

    I clearly don't understand how it works.

    Is this the best/correct way to do it please?

    I've already posted to https://www.mrexcel.com/board/thread...point.1226329/ but the reply advised the use of an Add-in which I tried to install but it didn't work. I'm running a fragile Windows 7 / Office 2010 and am wary about adding/installing anything that would risk it's operation. I'd prefer to use the standard formulas and equations if possible.
    Last edited by fixit9660; 01-11-2023 at 05:16 AM.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,719

    Re: 2nd Polynomial Trendline prediction

    Administrative Note:

    We would very much like to help you with your query, however it has been brought to our attention that the same query has been posted on one or more other forums and you have not told us about this. You are required to do so.

    Please see Forum Rule #3 about cross-posting and adjust accordingly. Read this to understand why we (and other sites like us) consider this to be important: https://excelguru.ca/a-message-to-forum-cross-posters/

    (Note: this requirement is not optional. No help to be offered until you provide a link or, for members with fewer than 10 posts, a comment telling us where else you have posted this query.)
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,013

    Re: 2nd Polynomial Trendline prediction

    I have your solution. But... you MUST first tell us where else you have cross-posted this.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,013

    Re: 2nd Polynomial Trendline prediction

    OK. Try:

    =LINEST(C2:INDEX(C:C,MATCH(10^10,E:E)),E2:INDEX(E:E,MATCH(10^10,E:E))^{1,2})

    You seem to be using an older version of Excel than me. So, please refer to the attached file. If the formulae are enclosed within a pair of { }, these are array formulae.

    These are a little different from ordinary formulae in that they MUST be confirmed in the FIRST CELL ONLY by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER.

    You will know the array is active when you see the curly brackets { } appear around the outside of your formula. If you do not use CTRL+SHIFT+ENTER you will (almost always) get an error message or an incorrect answer. Press F2 on that cell and try again.

    Don't type the curly brackets yourself - it won't work...
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    03-19-2013
    Location
    Somerset, UK.
    MS-Off Ver
    Excel 2010
    Posts
    16

    Re: 2nd Polynomial Trendline prediction

    As per your recommendation I've tried this but I'm not getting the results I expect.

    I understand the Ctrl + Shift + Enter function entry, and have no problem except that I need to select 3 horizontal cells to display the full output of the equation. I'm assuming that the last Cell value is supposed to be the Date since its format/result is the nearest? In my sheet, and the one you supplied, I get a value of 44553.854 which converts to a Date of 23/12/2021. I am expecting a value much nearer 45015 which approximately agrees with the graph date 30/03/2023.

  6. #6
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,819

    Re: 2nd Polynomial Trendline prediction

    You must pay careful attention to exactly what you are doing.

    Your original LINEST() functions (and the chart trendline regression) were regressing y=volume against x=date serial number (y=ax^2+bx+c)
    Glenn's formula is regression x=date serial number against y=volume. x=ay^2+by+c. In this equation, c is indeed the x intercept for polynomial, but it's not the same x intercept as you would get regressing volume against date.

    It should be as easy as switching the column C and column E references in the INDEX() functions (not the MATCH() functions) in Glenn's formula

    =LINEST(E2:INDEX(E:E,MATCH(10^10,E:E)),C2:INDEX(C:C,MATCH(10^10,E:E))^{1,2})

    Then you should get the same polynomial coefficients as the chart trendline, and you should then be able to use the quadratic formula to find the x intercepts of the polynomial.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  7. #7
    Valued Forum Contributor
    Join Date
    10-14-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2019
    Posts
    353

    Re: 2nd Polynomial Trendline prediction

    Maybe you can use the equation as Excel can show on the chart.
    You should set the accuracy high, so use scientific with 15 decimal digits.
    You can manually copy the equation from the chart and paste it into a cell
    with string formulas you can explode the equation into its parameters
    the parameters can be used to plot youre trendline.
    in the attachment i used VBA macro to get the equation out of the chart.
    The rest you can see in the sheet......
    Hope this helps
    Attached Files Attached Files
    Kind regards,
    Piet Bom

+ 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. [SOLVED] Polynomial trendline
    By Xtian in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 03:05 PM
  2. Polynomial trendline
    By Bernie Deitrick in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 09-06-2005, 07:05 AM
  3. Polynomial trendline
    By Bernie Deitrick in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 09-06-2005, 06:05 AM
  4. Polynomial trendline
    By Xtian in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 02:05 AM
  5. Polynomial trendline
    By Xtian in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 12:05 AM
  6. Polynomial trendline
    By Xtian in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 11:05 PM
  7. [SOLVED] Polynomial trendline
    By Xtian in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 10:05 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