Excel VAR.P and VAR.S: population and sample variance

In Excel, use VAR.P for the variance of an entire population and VAR.S to estimate population variance from a sample. VARP and VAR are their legacy counterparts. The choice depends on your scope. For example, you might measure every item a factory made that day or use a sample to estimate the variance of all its output.

Why population and sample variance use different divisors

Subtract the mean from each value, square the differences, and add them. VAR.P divides this sum by the number of values n. VAR.S divides by n−1. For 1, 2, and 3 the mean is 2 and the squared differences sum to 1+0+1=2, so the variances are 2/3 and 1. Both use squared units. The sample mean is estimated from those same values, so the deviations sum to zero and only n−1 can vary independently. This correction accounts for the tendency to underestimate population variance in random samples.

Compare the results on the numbers 1 to 10

Enter 1 through 5 in A1:E1 and 6 through 10 in A2:E2. Put each formula below in a separate cell outside the data. The first two formulas treat the range as the population and a sample, respectively. The last two are the corresponding compatibility functions found in older workbooks.

=VAR.P(A1:E2)
=VAR.S(A1:E2)
=VARP(A1:E2)
=VAR(A1:E2)

The mean is 5.5 and the squared differences sum to 82.5. Dividing by 10 gives 8.25 and dividing by 9 gives about 9.1667. For the same range with at least two numbers, with some variation, VAR.S is larger. If all values are equal, both results are zero.

Check blanks, zeros, and numbers stored as text

In G1:G4, enter 1, 2, and 3 and leave G4 blank. The formula below gives about 0.6667. Type 0 in G4 and the mean changes to 1.5 and the population variance to 1.25. Keep missing values distinct from measured zeros.

=VAR.P(G1:G4)

Blank cells, text, and logical values in a referenced range are excluded from this calculation. If the result looks wrong, check for numbers stored as text and errors in the source range. VAR.P needs at least one number and VAR.S needs at least two. A sample with a single number has a zero divisor and returns #DIV/0!.

Label variance and standard deviation clearly in reports

Standard deviation is the square root of variance and uses the original unit. If the measurements are in cm, variance is in cm² and standard deviation in cm. State which measure you used and whether it covers the population or a sample.

Microsoft’s VAR.P function reference

Microsoft’s VAR.S function reference

Microsoft’s VARP function reference

Microsoft’s VAR function reference