+ Reply to Thread
Results 1 to 7 of 7

SLOPE formula help!

  1. #1
    Registered User
    Join Date
    05-30-2017
    Location
    US
    MS-Off Ver
    2016
    Posts
    8

    Lightbulb SLOPE formula help!

    Hey everybody,

    I am looking for help with a slope formula that will give me the slope of a range of values within a given time period. I am using it as a backup to a MIN formula to look for unexpected upward ticks in a trend that should be negatively sloped. i.e. my MIN formula would not catch an upward trend and would find the value at the beginning, making my graph look like it has bottomed-out when it actually is increasing (embarrassing observation from my PI).

    I have a time column (A) and an observed values column (B). I want to set it up so that when I input the Final Time, I can automatically calculate the slope of the set of data (column B) in the range of time: "final time-30sec...final time." It doesn't need to be an accurate fit, just give me a rough trend of data so I can be aware if it is increasing unexpectedly.


    Lvl 2: I don't know if this would even be an option but it would be cool to perform this function in the background as a conditional formatting for my regular MIN calculations and if (+) sloped, then highlight the corresponding cell in the same range of values.

    Thank you in advance!
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: SLOPE formula help!

    ive tweaked the formula slightly to get the Min/Max to encompass the range to determine the X,Y for your Slope

    For instance
    E-09
    your slope formula should be Slope(B56:B196,A56:A196) right?
    whereby row 56 is your start and the 196 is your finish?

    if so then CSE formula again
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    ive included the results of min/max seperately so you can verify and check results are as expected

    on the conditional format bit then
    i just used a simple formula for cell with Slope>0
    Attached Files Attached Files
    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  3. #3
    Registered User
    Join Date
    05-30-2017
    Location
    US
    MS-Off Ver
    2016
    Posts
    8

    Re: SLOPE formula help!

    The formula is a bit beyond my excel knowledge so forgive me if I can't pick out what is missing. What I can see is that the MAX/MIN values don't match the sample charts below (E.g. 10E-9 should give a ~3.05MAX and ~2.94MIN)

    You have correctly identified the slope, the numbers calculated just seem odd to me and I am not sure how to interpret them.

    I've updated the workbook below.


    P.S. Kudos! that MAX/MIN equation is the one you gave me earlier and has been working fantastically. I just hit some weird data points I wasn't expecting.



    THanks again.
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: SLOPE formula help!

    i am very unfamiliar with whatever you are actually doing
    so not quite sure what the "desired" is in column G

    what i gave you previously was the representative ROW of the time frame range
    so for E-09
    14:48:12 starts at Row 56
    14:48:42 ends at Row 196
    to get the maximum VALUE of this range it would be max(B56:B196) right?

    if so then the formula would be
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    ...
    min value would be
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    both CSE formula as per usual

    updated file with these two formulas showing now attached
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    05-30-2017
    Location
    US
    MS-Off Ver
    2016
    Posts
    8

    Re: SLOPE formula help!

    Sorry, yes, those MAX/MINs are correct and I missed the ROW function (which is very helpful as well).

    The desired column G would be the slope values I would expect, given the plot and trendline in the data between the time ranges for each set of data (e.g. 10E-9, 10E-5).
    For example, I am trying to convert or match the value of the slope in O15 to something like G15. I don't know if this is just unit conversion or something up with the formula that is giving me a wholly different number.

    The conditional formatting works well.

  6. #6
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,843

    Re: SLOPE formula help!

    If I may interject a few thoughts:

    Why are the values in G14:G18 correct? They appear to be based on the slopes computed from the chart trendlines, but are these correct? In order to understand and interpret the chart trendline, one needs to note that:
    1) your chart is a line chart type.
    2) Because all of the "x" data is on the same day, a date axis has no meaning, so Excel chooses a text/category axis.
    3) which means that the x values going into the chart trendline are count numbers (1,2,3,4,...) rather than the actual time values.
    With that explained, one could interpret the chart slope as "change in units per entry". Your entries are not equally spaced in time. A quick look suggests that you are recording data approximately every 200 to 250 ms, so one could possibly interpret the slope as "change in units per 200 to 250 ms", but that is not a very precise slope.

    Looking at the humdingaling's slope function, it is using the actual date/time serial numbers for the regression. Assuming you are familiar with Excel's date/time serial number system, you will recall that 1 unit on this system is 1 day, so the -202.9... slope from his formula can be interpreted as "change in units per day". Doing the unit conversion to "change in units per 225 ms" (-203/24(hours/day)/60(min/hour)/60(sec/min)/0.225(sec/sec)) results in a slope of -0.000529 "change in units per 225 ms", which is close to the value from the chart trendline.

    At this point, it is my opinion (which is probably worth what you paid) that humdingaling's formula is technically more correct/accurate than the chart trendline (assuming that you are trying to recreate the chart trendline calculation). Recognizing that his result is "units per day", you can express the slope/rate in whatever units you want by performing an appropriate unit conversion.

    If you really decide that the chart trendline calculation is the more correct, then substitute an array of count numbers for the "known_x" argument in humdingaling's SLOPE() formula.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  7. #7
    Registered User
    Join Date
    05-30-2017
    Location
    US
    MS-Off Ver
    2016
    Posts
    8

    Wink Re: SLOPE formula help!

    Mr. Shorty,

    Thanks for helping with interpretation. I agree and will go with humdingaling's SLOPE formula with converted units.


    Thank you both!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Using INDEX to create cell references nested in a SLOPE formula
    By Bioc in forum Excel General
    Replies: 4
    Last Post: 02-05-2015, 08:20 AM
  2. Replies: 4
    Last Post: 08-26-2014, 09:28 AM
  3. [SOLVED] Array around Slope and Intercept Formula
    By Debbie Thomson in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 11-13-2013, 03:39 AM
  4. Simple Slope Formula Question
    By alecp in forum Excel General
    Replies: 2
    Last Post: 02-17-2012, 03:02 PM
  5. Slope of fit
    By DrDress in forum Excel General
    Replies: 3
    Last Post: 09-30-2011, 08:15 AM
  6. Is thre a way to use a multi-area selection in SLOPE() formula
    By THOMAS CONLON in forum Excel General
    Replies: 1
    Last Post: 07-24-2006, 01:00 PM
  7. [SOLVED] How to add slope formula to graph
    By jessrand in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 05-29-2006, 08:00 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1