Hi folks,
I'm not really sure if this is possible, or maybe it is, but more than I should be asking the forum for?
At a minimum, if its not doable, at lease someone can get the useful formulas for adjustable average and standard deviation from cells E4 and F4.
So,
I currently have a worksheet that takes measured values for a process and a residual, then it
Right now I use a loop procedure to change the input value (E4 in mini-sheet) and record the outcomes which for 6 months of run data and about 1200 individual processes/residuals, among other things, takes a little while.
I am okay with arrays, but don't even know how to approach calculating only in array and not in the spreadsheet one at a time.
Goal: To do this all in array.
I think I can figure out how to do simple math +, -, /, x inside an array, but have no idea how to go about doing the formulas below.
Example mini-sheet showing the data and calculations:
I'm not really sure if this is possible, or maybe it is, but more than I should be asking the forum for?
At a minimum, if its not doable, at lease someone can get the useful formulas for adjustable average and standard deviation from cells E4 and F4.
So,
I currently have a worksheet that takes measured values for a process and a residual, then it
- Calculates a ratio of the two
- An average of the ratio defined by a user input and
- The standard deviation of that same average ratio given the user input.
Right now I use a loop procedure to change the input value (E4 in mini-sheet) and record the outcomes which for 6 months of run data and about 1200 individual processes/residuals, among other things, takes a little while.
I am okay with arrays, but don't even know how to approach calculating only in array and not in the spreadsheet one at a time.
Goal: To do this all in array.
I think I can figure out how to do simple math +, -, /, x inside an array, but have no idea how to go about doing the formulas below.
- The average calculation formula =AVERAGE(OFFSET(D4,0,0,-(MIN(ROW()-ROW($D$3)+1,$E$1)),1))
- The standard deviation formula = IFERROR(STDEV.S(OFFSET(D4,0,0,-(MIN(ROW()-ROW($D$3)+1,$E$1)),1)),"")
- You can see in the manual example what these are doing, basically allowing a calculation of average or standard deviation when the date approaches less than the user input #.
Example mini-sheet showing the data and calculations:
Cell Formulas | ||
---|---|---|
Range | Formula | |
D4:D23,D27:D46 | D4 | =B4/C4 |
E4:E23 | E4 | =AVERAGE(OFFSET(D4,0,0,-(MIN(ROW()-ROW($D$3)+1,$E$1)),1)) |
F4:F23 | F4 | =IFERROR(STDEV.S(OFFSET(D4,0,0,-(MIN(ROW()-ROW($D$3)+1,$E$1)),1)),"") |
A4,A27 | A4 | =TODAY() |
A5:A23,A28:A46 | A5 | =A4-1 |
E27:E46 | E27 | =AVERAGE(OFFSET(D27,0,0,-(MIN(ROW()-ROW($D$3)+1,4)),1)) |
F27:F46 | F27 | =AVERAGE(OFFSET(D27,0,0,-(MIN(ROW()-ROW($D$3)+1,6)),1)) |
G27:G46 | G27 | =AVERAGE(OFFSET(D27,0,0,-(MIN(ROW()-ROW($D$3)+1,8)),1)) |
H27:H46 | H27 | =AVERAGE(OFFSET(D27,0,0,-(MIN(ROW()-ROW($D$3)+1,10)),1)) |
I27:I46 | I27 | =IFERROR(STDEV.S(OFFSET(D27,0,0,-(MIN(ROW()-ROW($D$26)+1,4)),1)),"") |
J27:J46 | J27 | =IFERROR(STDEV.S(OFFSET(D27,0,0,-(MIN(ROW()-ROW($D$26)+1,6)),1)),"") |
K27:K46 | K27 | =IFERROR(STDEV.S(OFFSET(D27,0,0,-(MIN(ROW()-ROW($D$26)+1,8)),1)),"") |
L27:L46 | L27 | =IFERROR(STDEV.S(OFFSET(D27,0,0,-(MIN(ROW()-ROW($D$26)+1,10)),1)),"") |