# Slope Function in Excel



## dfriend846 (Aug 11, 2005)

I am running a lab experiment where I collect the time and temperature as an object cools. I want to plot the results of this and also the value of the derivative or slope i.e. the rate of change of temperature as a function of time. My questions are:
1. Does Excel have a built-in derivative or slope function or should I just calculate it manually as the change in temperature divided by the time interval? This is what I have been doing. 
2. In addition to the plot of temperature and time I want to report the maximum value of the temperature rate of change and the temperature where it occurs. The max value of the rate change is easy to get by using the max function but how do i go about determining the temp value which is in the next column over? 

I've attached two screenshots to try to make it clearer. One is the graph I am producing and the second is a fraction of the data. It shows three columns for time, temperature and first derivative or slope. 

Any help would be greatly appreciated. Thanks in advance.

Dennis


----------



## bomb #21 (Jul 1, 2005)

There *is* a built in SLOPE function. Help says it "returns the slope of the linear regression line through data points in known_y's and known_x's". Which is all Greek to me. 

To get the value next to (right of) max, try (something like):

*=INDEX(B:B,MATCH(MAX(A:A),A:A,0))*

(i.e. index the column "next door").


----------



## dfriend846 (Aug 11, 2005)

Thanks, I will try the Index function you suggest. The Slope function is not really applicable because it assumes a straight line over the range which the temperature decay (blue line in graph) is not. If I used it I would get a single average value. The slope is defined as the change in temperature divided by the change in time and these are the red values. In the parts of the blue line that are steep the slope value is higher.


----------



## bomb #21 (Jul 1, 2005)

OK. But, if you have *any* chart issues, Jon Peltier's site is _always_ worth a visit -- he's some kind of charts/maths genius (whereas I'm neither  ).

http://www.peltiertech.com/index.html

rgds,
bomb


----------



## Jimmy the Hand (Jul 28, 2006)

You can always create custom functions, if Excel fails to meet your demands. For demo, I created two functions, called CustomSlope1 and CustomSlope2. They are in the attached workbook. I think their usage is more or less obvious, if not, then take a look at the code. (Understanding CustomSlope2 requires a bit of knowledge about built-in Offset method in VBA.) 

If any of the two suits you, good. If not, tell us your needs or ideas in detail, and I'm sure we can concoct something useful for you. Or maybe you can do it yourself, with some guidelines.


----------



## Zack Barresse (Jul 25, 2004)

bomb #21 said:


> ...Jon Peltier's site is _always_ worth a visit -- he's some kind of charts/maths genius...


That is probably because he went to MIT.


----------



## bomb #21 (Jul 1, 2005)

firefytr said:


> That is probably because he went to MIT.


OK, that would explain _that_. OTOH, I'll bet *you* didn't go to some fancy schmancy college yet still you run rings round me. Go figure.


----------



## Zack Barresse (Jul 25, 2004)

LOL! Just the school of hard knocks. And I wouldn't say rings, my friend, I think you're just as good as I am - or better - and far more original.  So no more of this nonsense.


----------



## dfriend846 (Aug 11, 2005)

Wow! I came back after a few days to find a lot to look at. I will report in again with (hopefully) success and put the solution for the next guy. 

Dennis


----------

