Calculation of Slope & Intecept of Logarithmic Trendline

gammyleg

New Member
Joined
Mar 2, 2018
Messages
7
Hi,

I have produced an x-y scatter chart from the following two columns of data.

åkDt hoursComp. Strength (N/mm²)

<tbody>
</tbody>

11.366.2
16.3112.9
25.1818.4
29.3624.4
38.2130.5
88.4141.4
349.2963.6

<tbody>
</tbody>

The X scale is formatted to Logarithmic Base 10 and I have added a logarithmic trendline which also displays slope/intercept equation on the chart. In this case it is:

y = 16.72ln(x) -33.445

I then have to manually input these figures elsewhere to carry out further calculations.

Can someone please tell me how to calculate to two numbers without having to produce the chart and trendline.

Thanks in advance.
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
Don't forget that these two are equivalent formulas:
y = 16.72 ln(x) - 33.445
y = 38.50 log(x) - 33.445

38.50/16.72 = ln(10) = 2.303

I show both of these since you noted that you used a log-base-ten axis scale.

You can use SLOPE() and INTERCEPT() to get the formula coefficients.

Assuming your X and Y values are in B2:B8 and C2:C8, you can use these array formulas:

{=SLOPE(C2:C8,LOG(B2:B8))}
{=INTERCEPT(C2:C8,LOG(B2:B8))}

which produce 38.50 and -33.445, or

{=SLOPE(C2:C8,LN(B2:B8))}
{=INTERCEPT(C2:C8,LN(B2:B8))}

which produce 16.72 and -33.445.

Don't type the curly brackets; hold Ctrl+Shift while pressing Enter and Excel puts them there to show these are curly brackets.

Alternatively, in cell A2 enter =LOG(B2) or =LN(B2) and fill it down to A8 and use non-array formulas

=SLOPE(C2:C8,A2:A8)
=INTERCEPT(C2:C8,A2:A8)

and you'll get 38.50 or 16.72 as slope and -33.445 as intercept.
 
Upvote 0
John Walkenbach, from http://spreadsheetpage.com/index.php/tip/chart_trendline_formulas/, gives this set of formulas:

[A]ssume that your sheet has two named ranges: x and y.

Logarithmic Trendline
Equation: y = (c * LN(x)) + b
c: =INDEX(LINEST(y,LN(x)),1)
b: =INDEX(LINEST(y,LN(x)),1,2)

With your data, c = 16.72091 and b = -33.489.

I'll note that the trend line coefficients computed using LINEST are not always exactly what Excel uses in the chart. Jon Peltier's equations are conform more exactly to the chart equation.
 
Last edited:
Upvote 0
I'll note that the trend line coefficients computed using LINEST are not always exactly what Excel uses in the chart.

This depends on two things.

1. Older versions of Excel had issues with statistical calculations.

2. The trendline formula may truncate the coefficients with fewer digits than needed for accurate use via copying and pasting into the worksheet.
 
Upvote 0

Forum statistics

Threads
1,214,971
Messages
6,122,521
Members
449,088
Latest member
RandomExceller01

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top