Thursday, March 29, 2012

Excel formula references

I have a data list that will grow over time. The values are listed vertically in a column; most recent value at the bottom. I am trying to figure out how to setup a formula to figure out the standard deviation on the most recent 30 values automatically. For instance if the column contains 30 values and I add the 31st value, I'd like to have to have the standard deviation displayed in a cell and automatically shift from calculating on values 1-30 to values 2-31. Is this possible?

Jeff.

Looking in Books On Line (http://technet.microsoft.com/en-us/library/ms159220.aspx), I see that StDev is not a supported expression for export to Excel. Specifically:

For all other cases, such as an unsupported expression, a formula is not generated for Excel. Instead, the value is placed in directly in the cell.

This means that you would be required to calculate your standard deviation 'by hand' for the last 30 of the items in your list.

Is it a requirement that the calculation be done in the spreadsheet? How about having the standard deviation calculation done by a SQL query? TSQL has the STDEV to calculate a sample standard deviation and STDEVP to calculate a population standard deviation. Add a new dataset that calculates the correct standard deviation from the last 30 entries (sort in decending order and use the top command) and then display the value where the RowNumber equals the CountRows in your table.

Larry

No comments:

Post a Comment