PMT Function in Excel — With Examples (Loan Payment, Mortgage, Savings)
Learn the PMT function in Excel: monthly loan and mortgage payments, the negative sign, total interest, and savings goals.
Read Guide →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.
| Function | Use when | Divides by |
|---|---|---|
=STDEV.S(range) | Your data is a sample of a larger group | n − 1 |
=STDEV.P(range) | Your data is the whole population | n |
=STDEV(range) | Older name for STDEV.S — same result | n − 1 |
=STDEVP(range) | Older name for STDEV.P — same result | n |
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.
Weekly sales for two shops over six weeks. Both average £1,200:
| Week | London (£) | Leeds (£) |
|---|---|---|
| W1 | 1,200 | 900 |
| W2 | 1,250 | 1,500 |
| W3 | 1,180 | 1,100 |
| W4 | 1,220 | 1,400 |
| W5 | 1,150 | 1,000 |
| W6 | 1,200 | 1,300 |
| Average | 1,200 | 1,200 |
| STDEV.S | 34.06 | 236.64 |
| STDEV.P | 31.09 | 216.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.
Ask: do I have every value I care about, or only some of them?
If in doubt, use STDEV.S. It is the safer default for most everyday analysis.
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.
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.
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.
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.
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.
| Mistake | What happens | Fix |
|---|---|---|
| You used STDEV.P on a sample | The answer is slightly too small | Use 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 0 | STDEV.S needs at least two numbers |
| You expected the result in percent | The 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 range | STDEV.S and STDEV.P ignore empty cells, text and logical values | That is usually fine — but check the range really holds your numbers |
| You compared standard deviations of two different scales | The bigger number may just be the bigger scale | Compare the coefficient of variation instead |
| You used the old STDEV name in a shared file | It works, but it hides whether it is a sample or a population | Use STDEV.S or STDEV.P in new work |
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.
Learn the PMT function in Excel: monthly loan and mortgage payments, the negative sign, total interest, and savings goals.
Read Guide →Learn the percentile formula in Excel: 90th, 75th and 95th percentiles, quartiles, and PERCENTILE.INC vs EXC — with worked examples.
Read Guide →Learn the p value formula in Excel: T.TEST, what 0.05 means, one-tailed vs two-tailed, and the mistakes to avoid.
Read Guide →