Enter each value with the weight it should carry. Weights can be any positive numbers — counts, allocations, or measures of confidence — and do not need to sum to 1.
| Value (x) | Weight (w) | Remove |
|---|---|---|
Weights may be counts, portfolio allocations, or any positive measure of importance. They do not need to sum to 1.
Show the working, step by step
The formulas
The weighted mean puts each value in proportion to its weight:
μw = Σ(w·x) / Σw
The weighted variance measures squared deviations from that mean, again weighted:
Population: σ²w = Σw(x − μw)² / V₁ Sample: s²w = Σw(x − μw)² / (V₁ − V₂/V₁) where V₁ = Σw and V₂ = Σw²
The sample denominator is the weighted analogue of Bessel's correction. Setting every weight to 1 makes V₁ = n and V₂ = n, so V₁ − V₂/V₁ becomes n − 1 — the ordinary formula falls out as the special case, which is the sign that the generalisation is the right one.
Two kinds of weight
The distinction matters for which denominator is correct, and it is glossed over often enough to cause real disagreements between software packages.
| Frequency weights | Reliability weights | |
|---|---|---|
| A weight of 5 means | This value occurred 5 times | Trust this value 5× as much |
| Effective n | Σw | V₁²/V₂ (Kish) |
| Sample denominator | Σw − 1 | V₁ − V₂/V₁ |
| Typical use | Frequency tables, tallies | Portfolios, survey weights, meta-analysis |
This calculator uses the reliability-weight convention, which is what NIST and most statistical software implement. For frequency data — where a weight is genuinely a repeat count — the grouped data calculator is the better fit and uses Σf − 1.
Where weighted spread is the honest measure
- Portfolio risk. Holdings are weighted by allocation. A 40% position's volatility should count more than a 2% position's. (A full portfolio calculation also needs the covariances between holdings — this formula treats the values as independent.)
- Survey data. Respondents carry design weights so the sample matches the population. Ignoring them biases both the mean and the spread.
- Meta-analysis. Studies are weighted by precision, typically the inverse of their variance, so larger and tighter studies drive the pooled result.
- Grades. A final exam worth 50% and a quiz worth 5% should not contribute equally to the spread of a student's performance.
Weighted standard deviation in Excel
Excel has no built-in weighted SD, so build it from array formulas:
Weighted mean: =SUMPRODUCT(A2:A10, B2:B10) / SUM(B2:B10) Weighted var: =SUMPRODUCT(B2:B10, (A2:A10 - [mean])^2) / SUM(B2:B10) Weighted SD: =SQRT( [the above] )
With values in column A and weights in column B. That gives the population form;
for the sample form divide by SUM(B2:B10) - SUMSQ(B2:B10)/SUM(B2:B10) instead.
Related calculators
-
Grouped data SD
When the weights are frequency counts.
-
Pooled SD
Weighting whole groups rather than individual values.
-
Standard deviation calculator
The unweighted case, where every value counts once.
-
Coefficient of variation
Relative spread, often reported alongside portfolio risk.
Common questions
What is a weighted standard deviation?
A standard deviation in which each value counts in proportion to a weight rather than counting once. It is used when observations differ in importance, reliability or size — for example a portfolio where each holding carries a different allocation.
Do the weights need to add up to 1?
No. The formula divides by the total weight, so any consistent positive scale works identically. Weights of 2, 3, 5 give exactly the same answer as 0.2, 0.3, 0.5.
What is the n − 1 equivalent for weighted data?
With reliability weights the bias-corrected denominator is V₁ − V₂/V₁, where
V₁ = Σw and V₂ = Σw². When every weight equals 1 this reduces to n − 1, which is the check
that it is the right generalisation.
This is the "Sample" mode above. If your weights are frequency counts rather than reliabilities, the plain Σw − 1 is the more conventional denominator.
When should I use frequency weighting instead?
If a weight means "this value occurred w times", you are describing a frequency table, and the grouped data calculator matches that intent more directly. Reliability weights — where a weight means "trust this value more" — belong here.