+ Reply to Thread
Results 1 to 7 of 7

Calculate slope with odd data points, and using IF statement?

  1. #1
    Registered User
    Join Date
    11-25-2010
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    82

    Calculate slope with odd data points, and using IF statement?

    Hi Guys,

    I'm using excel slope function to calculate whether a trend is positive or negative for traffic for a website.

    I saw this solution which worked however i can't seem to get it working when i have odd data points e.g. 5 month. Example:

    screenshot.6712.jpg

    It works well when even months, but not odd.

    How do i fix this?

    The other question is i want to create a if statement, so if the slope is negative or positive it will say in the projection column.

    What would the IF statement look like to do this in excel e.g. if number is negative add negative to column if positive...

    I have added the worksheet here: https://ufile.io/efc431

    Mods the attached feature in excel forum is not working see: https://www.useloom.com/share/1b4a3f...1279edea62fcd3

    Any suggestions would be very much appreciated!

    Cheers.

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

    Re: Calculate slope with odd data points, and using IF statement?

    The SLOPE() function only takes two arguments (known_x array and known_y array). You appear to be trying to feed it three arguments. (SLOPE() help file: https://support.office.com/en-us/art...a-61d7e01276b9 ).

    It is not clear to me what your are intending to use for your known_x and known_y arguments. I would have expected, as suggested in the linked discussion thread, that you would have entered an array of numbers (1,2,3,4,...) for each month and used that as your known_x argument, but you don't seem to be doing anything like that, so I am confused as to what you are trying to do. Once we have a better idea what your regression should look like without any IF() functions, then we will be better able to advise how to incorporate the IF conditions.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  3. #3
    Registered User
    Join Date
    11-25-2010
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    82

    Re: Calculate slope with odd data points, and using IF statement?

    Thanks for your response. What i'm trying to do is figure out with the traffic trend overall is up or down, i manage to calculate the slop with just 4 data points (Dec, Jan, Feb, March) but when i included (April) then the formula doesn't work.

  4. #4
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,212

    Re: Calculate slope with odd data points, and using IF statement?

    why not just create a range of x values (1,2,3,4,5)
    then slope (yvalues, xvalues)

    if you inserted a row at the top of the spreadsheet for the x's
    slope (b3:f3,b1:f1)

  5. #5
    Forum Expert avk's Avatar
    Join Date
    07-12-2007
    Location
    India
    MS-Off Ver
    Microsoft Office 2013
    Posts
    3,277

    Re: Calculate slope with odd data points, and using IF statement?

    slope function calculate between even series. (2,4,6,8,10 ..... columns)
    if you are using slope function, then you need to apply =slope(a2:c2,d2:f2) [range : this is for example]


    atul


    If my answer (or that of other members) has helped you, please say "Thanks" by clicking the Add Reputation button at the foot of one of their posts.

    Also: if your problem is solved, please take the time to mark your thread as SOLVED by going to the top of your first post, selecting "Thread Tools" and then "Mark thread as solved".

  6. #6
    Registered User
    Join Date
    11-25-2010
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    82

    Re: Calculate slope with odd data points, and using IF statement?

    Got it, i can see what i was doing wrong. Thanks guy!

    I changed months to array of numbers (1,2,3,4,...) which resulted to this:

    screenshot.6719.jpg

    It seems the number is quite low for that sharp increase in traffic e.g. from 25 visits to 1000 (in month 5) the slope is 0.34%.

    I want to get the IF statement working now for this figure, any suggestions on how to go about this?

    Cheers.

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

    Re: Calculate slope with odd data points, and using IF statement?

    I'm not sure how you got 0.34% either. I get a slope of 220/month.

    If I were doing an IF() statement on that, I would probably use something like =IF(slope < negative threshold,"negative",IF(slope <= positive threshold,"no change","positive))

+ 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. Calculate Degree Of Slope
    By NeedForExcel in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 03-09-2016, 12:42 AM
  2. [SOLVED] Find The Slope of Three Points
    By artiststevens in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 01-31-2016, 07:43 AM
  3. Replies: 5
    Last Post: 08-05-2015, 06:18 PM
  4. Replies: 1
    Last Post: 04-09-2014, 01:33 PM
  5. Replies: 3
    Last Post: 01-23-2014, 03:19 PM
  6. Calculating Slope and Intercept with a changing number of data points
    By WE5T in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-10-2013, 05:48 AM
  7. slope of a set of points
    By jcody in forum Excel General
    Replies: 3
    Last Post: 09-20-2012, 10:10 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