Back to TIL
product

STDEV.S vs STDEV.P

In Excel there are quite some functions that have a .S or .P at the end, like STDEV.S and STDEV.P. I wanted to know what the difference is and when to use what.

This came up during my work on the volatility calculators.

Thankfully, there are good explanations over in the r/excel subreddit. Not all of them agree, but this seems to be the common thread:

  • .S stands for Sample
  • .P stands for Population
  • You use sample, if you only work on a smaller fraction of the data available to you. That seems to fall under “predictive statistics”. Which makes sense. If I have 600 days of sales numbers but only use 250, I’m really only using a sample.
    • Sample is also the more defensive method. It will add some more variance. So depending on your calculation’s goal, it might make sense to use it as you’d be more defensive.
    • This also makes sense if I want to use past data to make guesses about the future. Being defensive is good.
  • Population is best used when you are looking at all data that is available to you, your analysis is mostly about making sense of the past. (“descriptive statistics”)

In the case of my volatility calculator, I’m definitely sticking with STDEV.S. A general tool should use defensive techniques. You never know how much your users know.