Home  /  Blog  /  Finance & Stats
Finance & Stats

Standard Deviation Formula in Excel — STDEV.S vs STDEV.P Explained

By admin 26 November 2026 Finance & Stats

The average tells you the centre of your numbers. It does not tell you how spread out they are — and that is the part that matters when you are comparing two shops, two classes, or two months. Two shops can both average £1,200 a week and still be completely different: one steady, one all over the place. Standard deviation is the number that shows that spread, in the same unit as your data. In Excel the formula is one line — STDEV.S for a sample, STDEV.P for a whole population — and the only decision is which one to use. This guide gives you that formula first, shows it working on two shops with the same average, works one small example through by hand so you can see what the function is doing, and ends with the mistakes that catch everyone.

Quick takeaway: standard deviation shows the spread, in the same unit as your data.

  • =STDEV.S(A2:A11) — your data is a sample of a bigger group. The usual choice.
  • =STDEV.P(A2:A11) — your data is the whole population. Use it only then.
  • STDEV.S divides by n − 1, STDEV.P divides by n, so STDEV.S is always slightly larger.
  • If in doubt, use STDEV.S.
Standard Deviation Formula in Excel — STDEV.S vs STDEV.P Explained

The Formula — STDEV.S or STDEV.P

FunctionUse whenDivides by
=STDEV.S(range)Your data is a sample of a larger groupn − 1
=STDEV.P(range)Your data is the whole populationn
=STDEV(range)Older name for STDEV.S — same resultn − 1
=STDEVP(range)Older name for STDEV.P — same resultn

STDEV and STDEVP are the old names from before Excel 2010. They still work, and they give the same answers as STDEV.S and STDEV.P. Use the .S and .P names in new work — they say what they do.

What Standard Deviation Means — Two Shops, Same Average

Weekly sales for two shops over six weeks. Both average £1,200:

WeekLondon (£)Leeds (£)
W11,200900
W21,2501,500
W31,1801,100
W41,2201,400
W51,1501,000
W61,2001,300
Average1,2001,200
STDEV.S34.06236.64
STDEV.P31.09216.02

The averages are identical. The standard deviations are not: London’s is £34.06, Leeds’ is £236.64 — nearly seven times larger. London’s sales sit close to the average every week. Leeds’ swing from £900 to £1,500. That is what the average hides and the standard deviation shows. A low standard deviation means the numbers cluster around the average. A high one means they spread far from it.

STDEV.S or STDEV.P — One Question Decides It

Ask: do I have every value I care about, or only some of them?

  • Sample — use STDEV.S. Your data is part of a larger group, and you want to draw a general conclusion. Six weeks of sales to judge how steady a shop is, 50 customers surveyed out of 2,000, 20 parts checked from a production run: all samples. This is the usual case.
  • Population — use STDEV.P. Your data includes every item you care about and you are not generalising. The marks of all 28 pupils in a class to describe that class, the salaries of every employee in a small firm: that is the whole population.

If in doubt, use STDEV.S. It is the safer default for most everyday analysis.

Why the Two Functions Give Different Answers

Both functions run the same calculation with one difference in the last step. Each value’s distance from the mean is squared, the squares are added up, and then the total is divided — by n − 1 in STDEV.S, by n in STDEV.P (n = the number of values). Dividing by n − 1 makes up for the fact that a sample’s values sit a little closer to its own average than the whole group’s do. So STDEV.S is always slightly larger. On the two shops, the gap is visible with 6 values. With several hundred values, the two results are almost identical.

Worked by Hand — Five Numbers, Step by Step

The function does the maths for you, but seeing it once by hand makes the number mean something. Five values: 4, 8, 6, 5, 7.

  1. Find the mean. (4 + 8 + 6 + 5 + 7) / 5 = 30 / 5 = 6.
  2. Find each value’s distance from the mean, and square it. 4 − 6 = −2, squared is 4. 8 − 6 = 2, squared is 4. 6 − 6 = 0, squared is 0. 5 − 6 = −1, squared is 1. 7 − 6 = 1, squared is 1.
  3. Add the squares. 4 + 4 + 0 + 1 + 1 = 10.
  4. Divide. For the population, divide by n = 5: 10 / 5 = 2. For the sample, divide by n − 1 = 4: 10 / 4 = 2.5.
  5. Take the square root. √2 = 1.4142 (STDEV.P). √2.5 = 1.5811 (STDEV.S).

Check it in Excel: =STDEV.S(A2:A6) gives 1.5811 and =STDEV.P(A2:A6) gives 1.4142 on the same five numbers. Same data, two answers — and now you know why.

Standard Deviation vs Variance

Variance is the step before the square root: the average of the squared distances. For the five numbers above, the sample variance is 2.5 and the population variance is 2. The function is VAR.S (sample) and VAR.P (population). Standard deviation is simply the square root of variance — which is why it is the one people report: it is in the same unit as the data (pounds, days, marks), while variance is in squared units, which no one can picture. If you only need one number, use standard deviation.

Compare Spread Across Different Scales — The Coefficient of Variation

A standard deviation of £236 sounds big, and £34 sounds small — but big compared to what? Divide by the mean to compare spread across different scales:

=STDEV.S(B2:B7)/AVERAGE(B2:B7)

Formatted as a percentage, London’s is 2.8% and Leeds’ is 19.7%. Now the comparison is fair: Leeds’ sales vary by almost a fifth of their average, London’s by less than a thirtieth. Use this whenever you compare two sets with different averages — two shops, two months, two products.

Common Mistakes

MistakeWhat happensFix
You used STDEV.P on a sampleThe answer is slightly too smallUse STDEV.S unless you have every value
You used STDEV.S on one number#DIV/0! — it divides by n − 1, and 1 − 1 is 0STDEV.S needs at least two numbers
You expected the result in percentThe result is in the same unit as your data (£, days, marks)To compare across scales, divide by the mean (coefficient of variation)
You included text or blanks in the rangeSTDEV.S and STDEV.P ignore empty cells, text and logical valuesThat is usually fine — but check the range really holds your numbers
You compared standard deviations of two different scalesThe bigger number may just be the bigger scaleCompare the coefficient of variation instead
You used the old STDEV name in a shared fileIt works, but it hides whether it is a sample or a populationUse STDEV.S or STDEV.P in new work

Frequently Asked Questions

What is the standard deviation formula in Excel? =STDEV.S(range) for a sample, or =STDEV.P(range) for a whole population. For example, =STDEV.S(A2:A11) gives the sample standard deviation of the ten numbers in A2:A11.

What is the difference between STDEV.S and STDEV.P? STDEV.S is for a sample and divides by n − 1. STDEV.P is for a whole population and divides by n. STDEV.S always gives a slightly larger result. If in doubt, use STDEV.S.

What does standard deviation tell me? How spread out your numbers are around their average. A low standard deviation means the numbers cluster close to the average; a high one means they spread far from it. The result is in the same unit as your data.

How do I calculate standard deviation in Excel step by step? Put your numbers in a column, click an empty cell, type =STDEV.S(, drag over your data, type ) and press Enter. Then format the result to a sensible number of decimals.

What is the difference between standard deviation and variance? Variance is the average of the squared distances from the mean. Standard deviation is the square root of variance — which puts it back in the same unit as your data, so it is the one people report.

Why does STDEV.S give #DIV/0!? It needs at least two numbers, because it divides by n − 1. A range holding a single number gives 1 − 1 = 0 in the denominator.

Can I use standard deviation in Google Sheets? Yes — STDEV.S and STDEV.P have the same names and the same meaning in Google Sheets.

That is the standard deviation formula in Excel: one line, STDEV.S for a sample and STDEV.P for a population, and one question to decide between them — do you have every value, or only some? The number it gives you is the spread of your data, in the same unit as the data itself, and it is the number that shows what the average hides. Two shops can average the same £1,200 and still be completely different, and the standard deviation is how you prove it. From here, the next statistics to learn are the other two in this silo — the average formula is the centre, and the weighted average formula is the centre when some values count more than others — and the full learning order for the whole site is on the Excel Formulas hub.


About admin

Author of Excel formula guides on this blog.

View all guides by admin →

Keep Learning

Related guides