# Microsoft Office Application Help - Excel Help forum > Excel Charting & Pivots >  >  equation of a line

## gbrown1

i have a plot of data on a logarithmic scale for the x-axis. I want to find the equation of the line which goes through all of the points. 

I tried to put a trendline through the points to get a similar line and then use the equation of the lone from that but it has proved too difficult to manage.

I am wondering if there is any way of obtaining the equation of the line without adding a trendline and asking for the equation to be displayed?

----------


## dude2007

this might help:

try going to tools->data analysis

then pick regression, highlight your data and click ok

a new sheet should open that shows results and u can pick out coefficients for your equation here...

but:

1)u have to have this data analysis toolpak installed or "data analysis" wont even show up in the tools menu (if u have the cd you can install it quickly)

2)im not sure if this runs only a linear regression or if log,exp etc is possible....
take care

----------


## gbrown1

i've managed to get the data analysis analysis toolpak to work and produce data and coefficients on the regression, however i am unsure of what coefficients to use to get my equation for the line?

i think it may only be a linear regression that is available but i am unsure...

thanks

----------


## ChemistB

What I've done in the past is set up (on a spreadsheet) 
Column A, x values
Column B, ln x values
Column C, y values
Then in any cell
=SLOPE(known y's, known x's (use ln x))
another cell
=INTERCEPT(known y's, known x's)
and lastly (to check your linearity)
=CORREL(y's, x's)

Then just use y =Slope * x + Intercept to calculate any y value

ChemistB

----------


## shg

If you want an exponential fit, use LOGEST to get the parameters of the curve, and GROWTH to interpolate or extrapolate.

----------

