+ Reply to Thread
Results 1 to 6 of 6

Using the IF function to specify which rows to use for SLOPE

  1. #1
    Registered User
    Join Date
    11-07-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    76

    Using the IF function to specify which rows to use for SLOPE

    Hi all

    Please help.
    I am unsure whether I need to use the INDEX function or not, though I suspect not.

    There is data in A14:K500
    A14:A500 contains different 3 letter abbreviations such as SFL and ISK
    I would like to calculate the slope, =SLOPE(D14:D500,B14:B500)
    but only using data from the lines where column A contains "SFL", for example.

    Also, how would I do it if I wanted to find the slope if A: contains either SFL or ISK


    Thanks
    Marco
    Last edited by milkychips; 12-21-2014 at 02:35 PM.

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,036

    Re: Slope.. IF...

    Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution.

    Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.

    To change a Title go to your first post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.

    (This thread should receive no further responses until this moderation request is fulfilled, as per Forum Rule 7)
    Never use Merged Cells in Excel

  3. #3
    Registered User
    Join Date
    11-07-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    76

    Re: Slope.. IF...

    I have renamed the post, sorry.

    Could you please reopen the thread

    Thanks
    Marco

  4. #4
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP, 2007, 2024
    Posts
    16,375

    Re: Using the IF function to specify which rows to use for SLOPE

    A sample spreadsheet would allow us to better help with specific solutions.

    According to the help file (https://support.office.com/en-us/art...rs=en-US&ad=US ) the slope function will ignore text, logical, or empty cells. I tend to use helper columns for this kind of thing. I would use a helper column =IF(criteria="sfl",xvalue,FALSE) for the xvalues and =IF(criteria="sfl",yvalue,FALSE) for the yvalues, then feed those two helper columns into the SLOPE() function. You can use an AND() or OR() function in the first argument of the IF() function to test multiple criteria.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  5. #5
    Registered User
    Join Date
    11-07-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    76

    Re: Using the IF function to specify which rows to use for SLOPE

    Thanks Mr Shorty.

    Could you please help me feed it into a formula.
    I have attached a simplified spreadsheet, A1:G11, with D to G the helper columns you suggest for SFL and ISK.

    What would I need write in both J13 and J14 to get the slope for those codes only?

  6. #6
    Registered User
    Join Date
    11-07-2012
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    76

    Re: Using the IF function to specify which rows to use for SLOPE

    As you said, the SLOPE function ignores text, logical, or empty cells so =SLOPE(E2:E11,D2:D11) works fine for SFL only.

    Thanks for your guidance

+ 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. Using INDIRECT within SLOPE
    By fred3 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 05-17-2014, 06:18 PM
  2. Slope problems
    By pelikaan in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-11-2013, 12:14 PM
  3. Slope of fit
    By DrDress in forum Excel General
    Replies: 3
    Last Post: 09-30-2011, 08:15 AM
  4. Conditional Slope
    By Ralem in forum Excel Programming / VBA / Macros
    Replies: 24
    Last Post: 05-19-2010, 04:39 PM
  5. [SOLVED] Slope of graph?
    By LJ555555 in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 09-27-2005, 10: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