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] 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 reopen merge delete

## Comments

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

## 5 Answers

Sort by » oldest newest most voted @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.

more

## Comments

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

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.

more

## Comments

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 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.

Cheers,

John

more

## Stats

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

Seen: 14,508 times

Last updated: Oct 15 '14