Thursday 30 March 2017

Excel- Microsoft Excel VAR Function

Description

The Excel VAR function returns the variance of a sample set of values from a population. 
The format of the function is : 

VAR( number1, [number2], ... ) 

Where the number arguments provide a minimum of 2 numerical values to the function. You can enter up to 254 number arguments to the Var function in Excel 2007 or Excel 2010, but you can only enter up to 30 number arguments in Excel 2003. 

Note that the Var function is used when calculating the variance for a sample of a population (eg. if your data set records the individual heights of a sample of UK males). If you are calculating the variance for an entire population, you need to use the Excel Varp or the Excel Var.P function. 

Note also, that the Var function ignores text values and logical values if these are supplied as part of an array. However, if they are supplied directly to the function, text representations of numbers and logical values are interpreted as numbers. If you want a sample variance calculation that does not ignore text and logical values that are supplied as a part of an array, consider using the Vara function. 


Var Function Example

Imagine you wanted to find out the variance of the heights of adult males in London. It is not realistic to measure the height of all males, but you could take a sample of the population and measure their heights. 

The example spreadsheet on the right stores the measurements (in cm) of 3,000 adult males. The measured heights are stored in cells B3 - B1002, D3 - D1002 and F3 - F1002. 
The variance of the heights of the sample group is calculated in cell H3 of the spreadsheet. The formula for this, as shown in the formula bar, is : 

=VAR( B3:B1002, D3:D1002, F3:F1002 ) 

As shown in cell H3, the variance of the individual heights of the sample group is 9.261904762 cm

Other Argument Types
The example above shows the arguments to the Var function being input in the form of 3 cell ranges. However, you can also input figures directly, as individual numbers or number arrays. 

For example, if you wanted to include two further heights, of 176cm and 177cm into the sample we could add these directly into the above function as follows: 
Either as individual numbers: 

=VAR( B3:B1002, D3:D1002, F3:F1002, 176, 177 ) 

Or, as an array of numbers: 

=VAR( B3:B1002, D3:D1002, F3:F1002, {176,177} ) 


Var Function Error
If you get an error from the Excel Var Function, this is likely to be the #DIV/0! error: 

Common Errors 




Some users may also encounter the following problem with the Var function: 
Common Problem: Values Stored as Text 

If you are getting an unexpected result from the Var function, this may be because you are supplying the function with text representations of numbers, rather than numerical values. 

The Var function will interpret logical values or text representations of numbers if they are supplied directly to the function. However, if the function is supplied with an array of cells containing logical values or text representations of numbers, these cells are ignored in the calculation. 

The different Excel data types are explained in more detail on the Excel Formatting page. 
Solution 

You can fix this problem by converting all text representations of numbers into numerical values. One way to do this is using the Text-To-Columns command: 






























No comments:

Post a Comment