We will be migrating from Ask to Discourse on the first week of August, read the details here

Ask Your Question

How to get the equation of a trend line in Calc? [closed]

asked 2014-07-13 10:36:36 +0200

student gravatar image

updated 2014-07-13 10:55:40 +0200

bencomp gravatar image

Suppose I have a (xy scatter) diagram in localc and insert a trend line, for example a linear one of the type f(x) = ax + b. I know hot to display the equation in the diagram, but how can I reference to the parameters a and b in a cell to make further calculations with it?

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by Alex Kemp
close date 2016-03-04 23:56:25.817643


@karolus: LO Calc :)

bencomp gravatar imagebencomp ( 2014-07-13 10:56:21 +0200 )edit

Oh, in ubuntu libreoffice calc can be started using the command localc

student gravatar imagestudent ( 2014-07-13 11:03:47 +0200 )edit

5 Answers

Sort by » oldest newest most voted

answered 2014-07-13 12:00:28 +0200

ROSt52 gravatar image

updated 2014-07-13 12:00:53 +0200

@student - As you know how to display the trend line equation just look at the equation and take the parameters you need. The parameters have a high number of digits thus the result should be sufficiently precise.

Due to complexity reasons I feel the the equations @karolus indicates are only available for linear trend lines.

An enhancement request to copy the parameters from trend line equations appears to me as a very interesting one.

Please feel free to post such an enhancement request at: https://www.libreoffice.org/get-help/... and publish the bug number here to allow other to add comments.

edit flag offensive delete link more


@ROSt52. I found a good solution to the problem link. I also filed a bug.

erotavlas gravatar imageerotavlas ( 2017-09-18 12:43:24 +0200 )edit

answered 2014-10-13 02:06:03 +0200

arielCo gravatar image

A less-than-convenient workaround:

Copy the equation in the chart to clipboard.

Start a new OO Draw window: File > New > Drawing

Paste the equation

Select the equation and right-click > Break

Now you can click into the text and copy/paste it as plain text anywhere you like.

From [Solved] Copy trendline equation as plain text

edit flag offensive delete link more


It really work, thank you!

Jekis gravatar imageJekis ( 2017-03-08 16:13:47 +0200 )edit

This is great. Only one detail: when copying the equation after braking it, note that any minus sign in the equation is taken as hifen. ;) Jorge

JrgSampaio gravatar imageJrgSampaio ( 2020-11-20 04:29:05 +0200 )edit

answered 2014-10-15 01:12:01 +0200

blindape gravatar image

To extract the trend line data from a series of x an y values, you can use the LINEST function. This function returns the values for s and b from your equation above. It can also return other tests such as the r squared value.

Because LINEST returns multiple results, it must be entered as an array formula. You do this by pressing Ctrl+Shift+Enter when you finish entering the formula. The results are returned to multiple cells. Approximately 2 columns wide by 5 rows high.

LINEST takes 4 arguments. 1 a list of Y-Values, 2 a list of x-values, 3 enter TRUE to force the vertical axis intercept to 0 or false for it to be calculated. 4. Enter TRUE to return regression statistics and FALSE to only return the values for a and b.

let us know if you have any questions.



edit flag offensive delete link more

Question Tools



Asked: 2014-07-13 10:36:36 +0200

Seen: 14,508 times

Last updated: Oct 15 '14