+ Reply to Thread
Results 1 to 8 of 8

SLOPE, IF and AND Functions

  1. #1
    Registered User
    Join Date
    10-07-2016
    Location
    Melbourne, Australia
    MS-Off Ver
    2016
    Posts
    3

    SLOPE, IF and AND Functions

    Hello,

    I am trying to calculate the slope of a set of data points, which are within a certain range.

    The function I am using is:

    =SLOPE(IF(AND(K14:K756>=I5,K14:K756<=I6),K14:K756),IF(AND(K14:K756>=I5,K14:K756<=I6),F14:F756))

    Where K14:K756 are the y-values, F14:F576 are the x-values. And then I5 and I6 are the conditions.

    Can anyone help me?

    Thanks!

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: SLOPE, IF and AND Functions

    K14:K756>=I5 won't do what you think--when a standard formula encounters a range where it is expecting a single value, it will only consider the top left cell of the range. This might work in an array formula, but I would have to have your data to set up a test.

    I'm not sure what you are trying to do with this condition. Are you selecting the entire range K14:K756 if all the points K14:K756 are between I5 and I6? Or are you trying to filter out only a subset of points that are between I5 and I6? If you mean the latter, there is no guarantee that the X's you select will correspond to the Y's you select.

    I suspect that this may be easier with "helper" columns that select the points according to your criteria.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    10-07-2016
    Location
    Melbourne, Australia
    MS-Off Ver
    2016
    Posts
    3

    Re: SLOPE, IF and AND Functions

    I am trying to select the data points between I5 and I6. The data is set up in a way that once I filter out the values I need the x and y values will be on the same row.

  4. #4
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: SLOPE, IF and AND Functions

    This is how I would do this in a simple way. It may be possible to do it without the helper columns by using a more complex formula, but this is easy to understand.
    Attached Files Attached Files

  5. #5
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: SLOPE, IF and AND Functions

    You nearly had it. It's just that you can't use AND to simulate such conditions with an array formula.

    Array formula**:

    =SLOPE(IF(K14:K756>=I5,IF(K14:K756<=I6,K14:K756)),IF(K14:K756>=I5,IF(K14:K756<=I6,F14:F756)))

    Regards


    **Array formulas are not entered in the same way as 'standard' formulas. Instead of pressing just ENTER, you first hold down CTRL and SHIFT, and only then press ENTER. If you've done it correctly, you'll notice Excel puts curly brackets {} around the formula (though do not attempt to manually insert these yourself).
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  6. #6
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: SLOPE, IF and AND Functions

    FWIW I prefer XOR LX's solution, just make sure you have an understanding of array formulas.

  7. #7
    Registered User
    Join Date
    08-19-2014
    Location
    Dallas, TX
    MS-Off Ver
    Office2013
    Posts
    44

    Re: SLOPE, IF and AND Functions

    You are defeating the purpose of the SLOPE formula by being so restrictive on the range. Speaking of purpose, what is the end-goal here. Please provide a small data set and the expected output you hope to achieve (and whatever meaning is to be attached to that output). There just isn't enough supporting information to provide us with what we need to help you.

  8. #8
    Registered User
    Join Date
    10-07-2016
    Location
    Melbourne, Australia
    MS-Off Ver
    2016
    Posts
    3

    Re: SLOPE, IF and AND Functions

    Hello,

    I want to calculate the slope of a stress strain curve. However, the data is inaccurate at the beginning of the test, and it is also hard to tell when the concrete starts acting plastic.
    Therefore, I have chosen to work out the slope using the 10% to 40% interval. This is typically done to get a value.

    Thanks guys. That last way worked.

    Thanks for all the help!

+ 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] Linest/slope functions with with different data ranges
    By Pat in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 06:05 PM
  2. [SOLVED] Linest/slope functions with with different data ranges
    By Pat in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 03:05 PM
  3. [SOLVED] Linest/slope functions with with different data ranges
    By Pat in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 12:05 PM
  4. [SOLVED] Linest/slope functions with with different data ranges
    By Pat in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 10:05 AM
  5. Linest/slope functions with with different data ranges
    By Pat in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 03:05 AM
  6. Linest/slope functions with with different data ranges
    By Pat in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 01:05 AM
  7. Linest/slope functions with with different data ranges
    By Pat in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 12:05 AM
  8. Linest/slope functions with with different data ranges
    By Pat in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-08-2005, 09:05 AM

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