+ Reply to Thread
Results 1 to 9 of 9

copying trendline formula into spreadsheet cell

  1. #1
    Registered User
    Join Date
    12-05-2016
    Location
    chicago
    MS-Off Ver
    2013
    Posts
    6

    copying trendline formula into spreadsheet cell

    Is there a way to copy a trendline equation into a cell? I always re-type the equation from the chart into the cell.

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

    Re: copying trendline formula into spreadsheet cell

    You can select the trendline label -> copy -> select cell -> paste to put the formula text into a cell. Of course, that is still just a useless text string.

    Because all of the build in trendline options are linear (or can be transformed to be linear), I prefer to perform regressions directly in the spreadsheet using the LINEST() function: https://support.office.com/en-us/art...a-fa7abf772b6d Will that be an acceptable option?
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  3. #3
    Registered User
    Join Date
    12-05-2016
    Location
    chicago
    MS-Off Ver
    2013
    Posts
    6

    Re: copying trendline formula into spreadsheet cell

    The problem is that the cut and paste or copy and paste feature does not work when trying to copy a formula from the chart. Otherwise, I would at least get the coefficients easily inserted into a cell and would only have to modify the variables, exponents, and include some multiplication signs. Still a pain, but I can't get anything to copy now.

    I would like to be able to easily create a column of formula-generated values along side the raw date values. I always have to re-invent the wheel each time by manually typing the equations.

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

    Re: copying trendline formula into spreadsheet cell

    I am not sure why you cannot copy anything from the trendline label to the spreadsheet. This is not a problem I run into, because I don't use the chart trendline to perform regressions. I use the LINEST() function and perform the regression in the spreadsheet. Are you required to use the chart trendline to perform the regression? Are you open to learning how to use the LINEST() function?

  5. #5
    Registered User
    Join Date
    12-05-2016
    Location
    chicago
    MS-Off Ver
    2013
    Posts
    6

    Re: copying trendline formula into spreadsheet cell

    I am open to LINEST(), but sometimes I want a quadratic or other function. I just spent a minute playing around with LINEST() and see that it gave me the slope right away. I didn't spend time to find the y-int. I will play around with it some more, but I still would like to be able to grab the equations off the chart.

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

    Re: copying trendline formula into spreadsheet cell

    The help file I linked to above includes an example for a cubic polynomial. Other polynomials (including quadratics) should be straightforward.

    I'm not sure why it did not give you the y-int. LINEST() is supposed to output a horizontal array with all of the "slopes" and the y-intercept in one array. If it only gave you the slope, that suggests that you only selected one cell when you entered the function -- be sure you are selecting the entire output array when you array enter the LINEST() function.

    If you are committed to copying equations off of the chart -- I guess the first thing is to figure out why it won't let you copy-paste the formula text into a cell. I have never had real trouble with that part. Once we get the text string to paste into a cell, we should be able to put the text manipulation functions together that will extract the coefficients from the text string.

  7. #7
    Registered User
    Join Date
    02-25-2020
    Location
    Salem,Oregon
    MS-Off Ver
    365
    Posts
    1

    Re: copying trendline formula into spreadsheet cell

    I had the same issue with copying the formula out.

    What worked for me was changing the format of the formula to number. In my version it asked how many decimal places you wanted so I added a bunch
    just to make sure my formula was accurate then copied it.

    You have to do a little bit of clean up.

    Remove the "y" from the beginning of the formula.
    The formula does not include the multiplication sign so "*" will need to be added.
    and you need to add "^" for values that are squared etc.
    I'm sure there are others but that was as complicated as my formulas got.

    Hope that helps.

  8. #8
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: copying trendline formula into spreadsheet cell

    If I'm working with a simple Linear equation, I always use the SLOPE and INTERSEPT functions to pull those out into a separate cell

    =SLOPE(y values, x values)
    =INTERSEPT(y values, x values)

    and then reference those cells.
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  9. #9
    Registered User
    Join Date
    11-20-2023
    Location
    Finland
    MS-Off Ver
    365
    Posts
    1

    Cool Re: copying trendline formula into spreadsheet cell

    My method is:
    -Try to copy the trendline equation by pressing CTRL+C 5 times.
    -Try to paste into Word
    -Fail
    -Return to Excel
    -Copy the equation by pressing CTRL+5 times
    -Go to Word
    -Paste successfully.

    The aforementioned works every time, though I'm not sure what makes it work. It just does.
    It's a lot faster than tinkering with the formatting or writing the equation over, at least.

+ 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. Replies: 4
    Last Post: 10-02-2016, 06:00 PM
  2. Replies: 7
    Last Post: 01-09-2014, 06:25 PM
  3. Accessing chart trendline equation with VBA or cell formula
    By BrianJC in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-07-2013, 03:26 PM
  4. Replies: 3
    Last Post: 02-23-2012, 12:04 PM
  5. Copying value from 1 cell from various spreadsheet
    By kchm_2000 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-22-2011, 02:50 AM
  6. how to enter the equation generated by a trendline in a spreadsheet
    By jonsandy1 in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 11-30-2010, 06:14 AM
  7. Displaying Trendline formula in Cell
    By aki096 in forum Excel General
    Replies: 4
    Last Post: 11-26-2008, 08:29 AM
  8. [SOLVED] Copying comments from one cell to another, in a different spreadsheet
    By =!CmOrE!= in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-24-2006, 08:45 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