Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

Excel statistical functions: VAR and VARP improvements and data consolidation


View products that this article applies to.

Summary

Microsoft Office Excel 2003 and later versions of Excel calculate the statistical functions VAR and VARP more accurately than earlier versions of Excel. Microsoft made the same algorithmic improvements for VAR and VARP when they are used to consolidate data.

In extreme cases, you may notice different values when worksheets that were created in earlier versions of Excel are recalculated in Excel 2003 and in later versions of Excel. This behavior also occurs with the STDEV and STDEVP functions because they calculate SQRT(VAR) and SQRT(VARP), respectively.

Microsoft Excel 2004 for Macintosh information

The statistical functions in Microsoft Excel 2004 for Macintosh were updated by using the same algorithms as Excel 2003 and later versions of Excel. Any information in this article that describes how a function works or how a function was modified for Excel 2003 and for later versions of Excel also applies to Excel 2004 for Macintosh.

↑ Back to the top


More information

The articles on VAR and VARP discuss how a two-pass procedure has replaced the one-pass "calculator formula" for calculating these measures. With infinite precision arithmetic, both procedures return the same results, and the calculator formula takes half as much time as the two-pass procedure.

However, with finite precision arithmetic, round-off errors can become a factor. With the two-pass procedure in Excel 2003 and in later versions of Excel, round-off errors in extreme situations are much less likely. However, you may not notice these improvements because, for most data sets, there are too few significant digits in the data to cause different results between the calculator formula and the two-pass procedure.

VAR and VARP are always more accurate in Excel 2003 and in later versions of Excel than in earlier versions of Excel, but differences in VAR and VARP between later versions of Excel and earlier versions of Excel are typically noticeable only if data values contain many significant digits, yet have small variation.

The following tables illustrate a situation in which earlier versions of Excel return incorrect values. Adding the same constant to every value in a data set should not affect the value of VAR. In the table, the Modified Value column contains the same entries as the Value column with the constant 10^8 added. To repeat the experiment, follow these steps:
  1. Open a new workbook, and then add a fourth worksheet named "Consolidation."
  2. Copy and paste the following four tables into Sheet1, Sheet2, Sheet3, and Consolidation. When you do this, select cell A1 on each sheet before the paste operation. When you do this, the tables fill A1:D2, A1:B2, A1:B2, and A1:B8, respectively.
  3. If you are using an earlier version of Excel, you can experiment more by changing the value of the power of 10 in Sheet1 cell D1. When you do this, you notice that VAR is well-behaved when this value is less than or equal to seven.

Sheet1

Value1Power of 108
Modified Value=B1+10^D1

Sheet2

Value2
Modified Value=B1+10^Sheet1!D1

Sheet3

Value3
Modified Value=B1+10^Sheet1!D1

Consolidation

VAR
Value=VAR(Sheet1:Sheet3!B1)
Modified Value=VAR(Sheet1:Sheet3!B2)
VAR using Modified Value when power of 10 added is set to 8:
in Microsoft Excel 2002:0
in Excel 2003 and in later versions of Excel:1
VAR of Value in cell B2 of the Consolidation sheet is 1. VAR of Modified Value in cell B3 of the Consolidation sheet is 1. The value 1 is the correct value if you use Excel 2003 or a later version of Excel. However, 0 is an incorrect value if you use an earlier version of Excel.

The article about VAR discusses modifications in the calculation. The article also gives you a worksheet for more extensive experimentation with adding a power of ten to data values.

For more information about VAR, click the following article number to view the article in the Microsoft Knowledge Base:
826112 Excel statistical functions: VAR

Results in earlier versions of Excel

Use of the calculator formula in earlier versions makes VAR and VARP, STDEV, and STDEVP are more susceptible to round-off errors. However, round-off errors that are significant enough for you to notice them occur only in extreme situations, particularly when data contains many significant digits but small variations.

Results in Excel 2003 and in later versions of Excel

The procedure that Excel 2003 and later versions of Excel use involves two passes through the data. On the first pass, the sample mean is calculated. On the second pass, the sum of squared deviations about this sample mean is calculated. This sum is then divided by one of the following values:
  • The number of observations minus one for VAR
  • The number of observations for VARP
This procedure minimizes the risk of round-off errors as compared to the calculator formula.

Conclusions

When you compare the values of VAR, VARP, STDEV, and STDEVP that are calculated by using earlier versions of Excel to values that are calculated by using Excel 2003 and later versions of Excel, you may occasionally see differences. In these cases, the values for Excel 2003 and for later versions of Excel are always more accurate. Typically, however, there is no difference between the values in the different versions of Excel.

↑ Back to the top


Keywords: KB829248, kbinfo, kbexpertisebeginner, kbformula

↑ Back to the top

Article Info
Article ID : 829248
Revision : 5
Created on : 1/19/2007
Published on : 1/19/2007
Exists online : False
Views : 441