+ Reply to Thread
Results 1 to 8 of 8

Standard Deviation over set points

  1. #1
    Forum Contributor
    Join Date
    05-01-2015
    Location
    Kent, England
    MS-Off Ver
    2013
    Posts
    148

    Question Standard Deviation over set points

    Hi all

    i have a lot of data that i am gathering every week and i want to plot the deviation of it over a set rolling 60 points so we can see step changes. i want to end up been able to plot a chart like the one attached. what i need is a way of calculating the standard deviation every 60 points so ideally P1:P60 show the average deviation of H1 against J1, then P61:P120 show the standard deviation of H61 against J61 so i can chart it like the attached.

    Then i can calculate the upper and lower deviation in Q and R
    Attached Images Attached Images
    Attached Files Attached Files

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,023

    Re: Standard Deviation over set points

    In one place you use the term standard deviation and in another the average deviation. Which do you want? The average deviation is the average of the difference between the result and the target. The standard deviation is a measure of the distribution of values around the mean value and is calculated from ONE dataset.

    Also, do you want the same value - the average/standard deviation of rows 2-61 in the first 60 rows and then the average/standard deviation of rows 62-121 in the next 60 rows and so on?
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  3. #3
    Forum Contributor
    Join Date
    05-01-2015
    Location
    Kent, England
    MS-Off Ver
    2013
    Posts
    148

    Re: Standard Deviation over set points

    Quote Originally Posted by Glenn Kennedy View Post
    In one place you use the term standard deviation and in another the average deviation. Which do you want? The average deviation is the average of the difference between the result and the target. The standard deviation is a measure of the distribution of values around the mean value and is calculated from ONE dataset.

    Also, do you want the same value - the average/standard deviation of rows 2-61 in the first 60 rows and then the average/standard deviation of rows 62-121 in the next 60 rows and so on?
    Hi Glenn

    Sorry i wrote this late last night, i want the average deviation and i do want the same values in the first 60 rows and so on.

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,023

    Re: Standard Deviation over set points

    I have just noticed that the dates in column C jump around all over the place. Do the data not need to be in date order for this to be meaningful? What is on the intended x-axis: date or simply row number? If it is date, it would be a lot easier if the data were in date order: then it would be each 60 rows.

    Also, your sample is too small, can you include about 200 rows so that there are a few "cycles" of 60 rows to play with.

  5. #5
    Forum Contributor
    Join Date
    05-01-2015
    Location
    Kent, England
    MS-Off Ver
    2013
    Posts
    148

    Re: Standard Deviation over set points

    Hi
    I have attached a larger data set, the date jumps as the data is from different running lines, my data will be charted using the week number not the actual date.
    Attached Files Attached Files

  6. #6
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,023

    Re: Standard Deviation over set points

    OK. So, IF I have picked you up correclty, this array formula will do what you want:

    =AVERAGE(OFFSET($I$2:$I$61,60*INT(ROWS(($2:2)-1)/60),,,)-100*OFFSET($H$2:$H$61,60*INT(ROWS(($2:2)-1)/60),,,))

    It might take a few seconds to process the data.

    Array Formulae are a little different from ordinary formulae in that they MUST be confirmed IN THE FIRST CELL by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. This cell can then be dragged down normally.

    You will know the array is active when you see curly brackets { } - or "curly braces" for those of you in the USA, or "flower brackets" for those of you in India - appear around the outside of your formula. If you do not use CTRL+SHIFT+ENTER you will (almost always) get an error message or an incorrect answer. Press F2 on that cell and try again.

    Don't type the curly brackets yourself - it won't work...
    Attached Files Attached Files

  7. #7
    Forum Contributor
    Join Date
    05-01-2015
    Location
    Kent, England
    MS-Off Ver
    2013
    Posts
    148

    Re: Standard Deviation over set points

    Quote Originally Posted by Glenn Kennedy View Post
    OK. So, IF I have picked you up correclty, this array formula will do what you want:

    =AVERAGE(OFFSET($I$2:$I$61,60*INT(ROWS(($2:2)-1)/60),,,)-100*OFFSET($H$2:$H$61,60*INT(ROWS(($2:2)-1)/60),,,))

    It might take a few seconds to process the data.

    Array Formulae are a little different from ordinary formulae in that they MUST be confirmed IN THE FIRST CELL by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. This cell can then be dragged down normally.

    You will know the array is active when you see curly brackets { } - or "curly braces" for those of you in the USA, or "flower brackets" for those of you in India - appear around the outside of your formula. If you do not use CTRL+SHIFT+ENTER you will (almost always) get an error message or an incorrect answer. Press F2 on that cell and try again.

    Don't type the curly brackets yourself - it won't work...
    Hi Glenn can you explain what each part of the formula is doing so i can better understand it?

    Thanks

  8. #8
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,023

    Re: Standard Deviation over set points

    Formula:

    =AVERAGE(OFFSET($I$2:$I$61,60*INT(ROWS(($2:2)-1)/60),,,)-100*OFFSET($H$2:$H$61,60*INT(ROWS(($2:2)-1)/60),,,))
    Basically, of course; it's looking at the difference between column I and column H. The OFFSET function works like this:

    =OFFSET(cell reference or range,how many rows to move, how many columns to move, width,height)

    So... OFFSET($I$2:$I$61 look at this range of cells and return the values: 60*INT(ROWS(($2:2)-1)/60) rows away.

    If you paste =60*INT(ROWS(($2:2)-1)/60) into a cell and copy down it'll return 0 for the fist 60 rows, then 60 for the next 60, then 120 for the next 60, etc. So for for the first 60 rows it returns the values in I2 to I61. After that it returns I62-I121 for the next 60 rows and so on...

    Clear as mud??



    You're welcome.



    If that takes care of your original question, please select "Thread Tools" from the menu link above and mark this thread as SOLVED.

    It'd also be appreciated if you were to click the Add Reputation button at the foot of any of the posts of all members who helped you reach a solution.

+ 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. Standard deviation of mean every nth row
    By grayham24 in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 08-24-2016, 02:53 AM
  2. Multiple shading for different standard deviation points
    By jennynz in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 10-07-2014, 11:27 AM
  3. standard deviation
    By mibikeks in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-21-2014, 02:24 PM
  4. Standard Deviation when only one value is available
    By benjamings in forum Excel General
    Replies: 2
    Last Post: 08-05-2010, 06:42 PM
  5. Excel 2007 : Standard Deviation
    By King_Junior in forum Excel General
    Replies: 8
    Last Post: 09-18-2009, 04:02 PM
  6. standard deviation
    By Chris in forum Excel General
    Replies: 1
    Last Post: 10-13-2005, 12: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