Skip to main content

Variance in Excel, Google Sheets, Python and R

Every tool can calculate variance, but they do not all mean the same thing by it. This guide lists the right function in each, and the defaults that quietly change your answer.

By the VarianceCalc team · Updated

Open the variance calculator

Frequently asked questions

Should I use VAR.S or VAR.P in Excel?

Use VAR.S when your data is a sample of a larger group, which is the usual case. Use VAR.P only when the range contains the entire population you care about.

What is the difference between VAR and VAR.S?

None in the result. VAR is the older name kept for compatibility and also calculates sample variance. Microsoft recommends VAR.S in new workbooks.

Why does numpy give a different variance from Excel?

numpy.var divides by n by default (population variance), while Excel's VAR.S divides by n − 1. Pass ddof=1 to numpy.var to match VAR.S.

Does Excel's VAR.S include blank cells or text?

No. When you pass a cell range, VAR.S and VAR.P ignore empty cells, text and logical values. VARA and VARPA count text as 0 and TRUE as 1.