Variance function in excel

Excel for Microsoft 365 Excel for Microsoft 365 for Mac Excel for the web Excel 2021 Excel 2021 for Mac Excel 2019 Excel 2019 for Mac Excel 2016 Excel 2016 for Mac Excel 2013 Excel 2010 Excel 2007 Excel for Mac 2011 Excel Starter 2010 More…Less

Estimates variance based on a sample.

Important: This function has been replaced with one or more new functions that may provide improved accuracy and whose names better reflect their usage. Although this function is still available for backward compatibility, you should consider using the new functions from now on, because this function may not be available in future versions of Excel.

For more information about the new function, see VAR.S function.

Syntax

VAR(number1,[number2],…)

The VAR function syntax has the following arguments:

  • Number1     Required. The first number argument corresponding to a sample of a population.

  • Number2, …     Optional. Number arguments 2 to 255 corresponding to a sample of a population.

Remarks

  • VAR assumes that its arguments are a sample of the population. If your data represents the entire population, then compute the variance by using VARP.

  • Arguments can either be numbers or names, arrays, or references that contain numbers.

  • Logical values, and text representations of numbers that you type directly into the list of arguments are counted.

  • If an argument is an array or reference, only numbers in that array or reference are counted. Empty cells, logical values, text, or error values in the array or reference are ignored.

  • Arguments that are error values or text that cannot be translated into numbers cause errors.

  • If you want to include logical values and text representations of numbers in a reference as part of the calculation, use the VARA function.

  • VAR uses the following formula:

    Formula

    where x is the sample mean AVERAGE(number1,number2,…) and n is the sample size.

Example

Copy the example data in the following table, and paste it in cell A1 of a new Excel worksheet. For formulas to show results, select them, press F2, and then press Enter. If you need to, you can adjust the column widths to see all the data.

Strength

1345

1301

1368

1322

1310

1370

1318

1350

1303

1299

Formula

Description

Result

=VAR(A2:A11)

Variance for the breaking strength of the tools tested.

754.2667

Need more help?

133

133 people found this article helpful

Find the spread of your data using variance and standard deviation

Updated on December 8, 2022

What to Know

  • Use the VAR.P function. The syntax is: VAR.P(number1,[number2],…)
  • To calculate standard deviation based on the entire population given as arguments, use the STDEV.P function.

This article explains data summarization and how to use deviation and variance formulas in Excel for Microsoft 365, Excel 2019, 2016, 2013, 2010, 2007, and Excel Online.

Summarizing Data: Central Tendency and Spread

The central tendency tells you where the middle of the data is, or the average value. Some standard measures of the central tendency include the mean, the median, and the mode.

The spread of data means how much individual results differ from the average. The most straightforward measure of spread is the range, but it’s not very useful because it tends to keep increasing as you sample more data. Variance and standard deviation are much better measures of spread. The variance is simply the standard deviation squared. 

A sample of data is often summarized using two statistics: its average value and a measure of how spread out it is. Variance and standard deviation are both measures of how spread out it is. Several functions let you calculate variance in Excel. Below, we’ll explain how to decide which one to use and how to find variance in Excel.

Standard Deviation and Variance Formula

Both the standard deviation and the variance mesure how far, on average, each data point is from the mean.

If you were calculating them by hand, you would start by finding the mean for all your data. You would then find the difference between each observation and the mean, square all those differences, add them all together, then divide by the number of observation.

Doing so would give the variance, a kind of average for all the squared differences. Taking the variance’s square root corrects the fact that all the differences were squared, resulting in the standard deviation. You will use it to measure the spread of data. If this is confusing, don’t worry. Excel does the actual calculations.

Sample or Population?

Often your data will be a sample taken from some larger population. You want to use that sample to estimate the variance or standard deviation for the population as a whole. In this case, instead of dividing by the number of observation (n), you divide by n-1. These two different types of calculation have different functions in Excel:

  • Functions with P: Gives the standard deviation for the actual values you have entered. They assume your data is the whole population (dividing by n).
  • Functions with an S: Gives the standard deviation for a whole population, assuming your data is a sample taken from it (dividing by n-1). It can be confusing, as this formula provides the estimated variance for the population; the S indicates the dataset is a sample, but the result is for the population.

Using the Standard Deviation Formula in Excel

To calculate the standard deviation in Excel, follow these steps.

  1. Enter your data into Excel. Before you can use the statistics functions in Excel, you need to have all your data in an Excel range: a column, a row, or a group matrix of columns and rows. You need to be able to select all the data without selecting any other values.

    For the rest of this example, the data is in the range A1:A20.

  2. If your data represents the entire population, enter the formula «=STDEV.P(A1:A20).» Alternatively, if your data is a sample from some larger population, enter the formula «=STDEV(A1:A20)

    If you’re using Excel 2007 or earlier, or you want your file to be compatible with these versions, the formulas are «=STDEVP(A1:A20),» if your data is the entire population; «=STDEV(A1:A20),» if your data is a sample from a larger population.

  3. The standard deviation will be displayed in the cell.

How to Calculate Variance in Excel

Calculating variance is very similar to calculating standard deviation.

  1. Ensure your data is in a single range of cells in Excel.

  2. If your data represents the entire population, enter the formula «=VAR.P(A1:A20).» Alternatively, if your data is a sample from some larger population, enter the formula «=VAR.S(A1:A20)

    If you’re using Excel 2007 or earlier, or you want your file to be compatible with these versions, the formulas are: «=VARP(A1:A20),» if your data is the entire population, or «=VAR(A1:A20),» if your data is a sample from a larger population.

  3. The variance for your data will be displayed in the cell.

FAQ

  • How do I find the coefficient of variation in Excel?

    There’s no built-in formula, but you can calculate the coefficient of variation in a data set by dividing the standard deviation by the mean.

  • How do I use the STDEV function in Excel?

    The STDEV and STDEV.S functions provide an estimate of a set of data’s standard deviation. The syntax for STDEV is =STDEV(number1, [number2],…). The syntax for STDEV.S is =STDEV.S(number1,[number2],…).

Thanks for letting us know!

Get the Latest Tech News Delivered Every Day

Subscribe

Variance in Excel

Excel Variance (Table of Contents)

  • Introduction to Variance in Excel
  • How to Calculate Variance in Excel?

Introduction to Variance in Excel

Variance is used in cases if we have some budgets, and we may know the variances observed in implementing the budgets. In some cases, the term variance is also used to calculate the difference between the planned and the actual results. Variance calculation is a great way for data analysis as this let us know the spread through of variation in the data set.

Variance is nothing but just information that shows us how well the data is spread through. Calculating variance is required, especially in cases where we have been doing a sampling of data. This is important because we use the correct function to calculate the variance like VAR.S or VAR.P. We have a few cases to calculate variance in excel where we have some data that has been projected for the period, and we want to compare that with the actual figures.

How to Calculate Variance in Excel?

Let’s understand how to Calculate Variance in Excel with some examples.

You can download this Variance Excel Template here – Variance Excel Template

Example #1 – Calculating variance in excel for the entire population

If the data set is for the complete population, then we need to use the VAR.P function of excel. This is because, in excel, we have two functions that are designed for different datasets.

We may have data that is collected based on sampling, which might be the population of the entire world.

VAR.P uses the following formula:

VAR.P Formula

Step 1 – Enter the data set in the columns.

variance example 1-1

Step 2 – Insert the VAR.P function and choose the range of the data set. Here one thing should be noted that if any cell has an error, then that cell will be ignored.

variance example 1-2

Step 3 – After pressing the Enter key, we will get the variance.

variance example 1-3

We have calculated the variance of Set B by following the same steps given above. The result of the variance of Set B is shown below.

variance example 1-4

Example #2 – Calculating the variance for sample size in excel

If we have data set that represents samples, then we need to use the function of VAR.S instead of using the VAR.P

This is because this function has been designed to calculate the variance, keeping in mind the sampling method’s characteristics.

VAR.S uses the following formula:

VAR.S Formula

Step 1 – Enter the data set in the column.

variance example 2-1

Step 2 – Insert the VAR.S function and choose the range of the data set.

variance example 2-2

Step 3 – We will get the variance.

variance example 2-3

We have calculated the variance of Set B by following the same steps given above. The result of the variance of Set B is shown below.

variance example 2-4

Example #3 – Calculating the quantum of variance for data in excel

We may just want to calculate the variance in the data, and we may need the variance in terms of quantity and not in terms of data analysis.

If we need to check the change, then we need to use the following method.

Step 1 – Calculate the difference that is between the two of the data by using the function of subtraction.

Calculating the quantum example 3-1

Step 2 – After pressing the Enter key, we will get the result. To get the entire data variance, we have to drag the formula applied to cell C2.

Calculating the quantum example 3-2

Step 3 – Now, the variance can be positive and negative, and this will be the calculated variance.

Example #4 – Calculating the percentage of variance for the data set in excel

We may need to calculate the percentage change in the data over a period of time, and in such cases, we need to use the below method.

Step 1 – First, calculate the variance from method 3rd.

Step 2 – Now calculate the percentage by using the below function.

Change in the value/original value*100. This will be our percentage change in the data set.

variance example 4-1

Step 3 – To get the percentage of the entire data variance, we have to drag the formula applied to cell D2.

variance example 4-2

Things to Remember About Variance in Excel

  • If we have data set that represents the complete population, then we need to use the function of VAR.P.
  • If we have a data set that represents the samples from the world data, then we need to use the function of VAR.S.
  • Here S represents the samples.
  • If we are calculating the change in terms of quantum, then a negative change means an increase in actual value and a positive change means a decrease in value.
  • In the case of using the VAR.P, the arguments can be number or name, arrays or reference that contains numbers.
  • If any of the cells that have been given as a reference in the formula contains an error, then that cell will be ignored.

Recommended Articles

This is a guide to Variance in Excel. Here we discussed How to calculate Variance in Excel along with practical examples and a downloadable excel template. You can also go through our other suggested articles –

  1. Top 25 Useful Advanced Excel Formulas and Functions
  2. FLOOR Function in Excel
  3. Excel Square Root Function
  4. Excel Variance

Содержание

  • Вычисление дисперсии
    • Способ 1: расчет по генеральной совокупности
    • Способ 2: расчет по выборке
  • Вопросы и ответы

Дисперсия в Microsoft Excel

Среди множества показателей, которые применяются в статистике, нужно выделить расчет дисперсии. Следует отметить, что выполнение вручную данного вычисления – довольно утомительное занятие. К счастью, в приложении Excel имеются функции, позволяющие автоматизировать процедуру расчета. Выясним алгоритм работы с этими инструментами.

Вычисление дисперсии

Дисперсия – это показатель вариации, который представляет собой средний квадрат отклонений от математического ожидания. Таким образом, он выражает разброс чисел относительно среднего значения. Вычисление дисперсии может проводиться как по генеральной совокупности, так и по выборочной.

Способ 1: расчет по генеральной совокупности

Для расчета данного показателя в Excel по генеральной совокупности применяется функция ДИСП.Г. Синтаксис этого выражения имеет следующий вид:

=ДИСП.Г(Число1;Число2;…)

Всего может быть применено от 1 до 255 аргументов. В качестве аргументов могут выступать, как числовые значения, так и ссылки на ячейки, в которых они содержатся.

Посмотрим, как вычислить это значение для диапазона с числовыми данными.

  1. Производим выделение ячейки на листе, в которую будут выводиться итоги вычисления дисперсии. Щелкаем по кнопке «Вставить функцию», размещенную слева от строки формул.
  2. Переход к мастеру функций в Microsoft Excel

  3. Запускается Мастер функций. В категории «Статистические» или «Полный алфавитный перечень» выполняем поиск аргумента с наименованием «ДИСП.Г». После того, как нашли, выделяем его и щелкаем по кнопке «OK».
  4. Переход к аргументам функции ДИСП.Г в Microsoft Excel

  5. Выполняется запуск окна аргументов функции ДИСП.Г. Устанавливаем курсор в поле «Число1». Выделяем на листе диапазон ячеек, в котором содержится числовой ряд. Если таких диапазонов несколько, то можно также использовать для занесения их координат в окно аргументов поля «Число2», «Число3» и т.д. После того, как все данные внесены, жмем на кнопку «OK».
  6. Аргументы функции ДИСП.Г в Microsoft Excel

  7. Как видим, после этих действий производится расчет. Итог вычисления величины дисперсии по генеральной совокупности выводится в предварительно указанную ячейку. Это именно та ячейка, в которой непосредственно находится формула ДИСП.Г.

Результат вычисления функции ДИСП.Г в Microsoft Excel

Урок: Мастер функций в Эксель

Способ 2: расчет по выборке

В отличие от вычисления значения по генеральной совокупности, в расчете по выборке в знаменателе указывается не общее количество чисел, а на одно меньше. Это делается в целях коррекции погрешности. Эксель учитывает данный нюанс в специальной функции, которая предназначена для данного вида вычисления – ДИСП.В. Её синтаксис представлен следующей формулой:

=ДИСП.В(Число1;Число2;…)

Количество аргументов, как и в предыдущей функции, тоже может колебаться от 1 до 255.

Lumpics.ru

  1. Выделяем ячейку и таким же способом, как и в предыдущий раз, запускаем Мастер функций.
  2. Перемещение к мастеру функций в Microsoft Excel

  3. В категории «Полный алфавитный перечень» или «Статистические» ищем наименование «ДИСП.В». После того, как формула найдена, выделяем её и делаем клик по кнопке «OK».
  4. Переход к аргументам функции ДИСП.В в Microsoft Excel

  5. Производится запуск окна аргументов функции. Далее поступаем полностью аналогичным образом, как и при использовании предыдущего оператора: устанавливаем курсор в поле аргумента «Число1» и выделяем область, содержащую числовой ряд, на листе. Затем щелкаем по кнопке «OK».
  6. Аргументы функции ДИСП.В в Microsoft Excel

  7. Результат вычисления будет выведен в отдельную ячейку.

Результат вычисления функции ДИСП.В в Microsoft Excel

Урок: Другие статистические функции в Эксель

Как видим, программа Эксель способна в значительной мере облегчить расчет дисперсии. Эта статистическая величина может быть рассчитана приложением, как по генеральной совокупности, так и по выборке. При этом все действия пользователя фактически сводятся только к указанию диапазона обрабатываемых чисел, а основную работу Excel делает сам. Безусловно, это сэкономит значительное количество времени пользователей.

Еще статьи по данной теме:

Помогла ли Вам статья?

Calculating variance allows you to determine the spread of numbers in a data set against the mean. This is a great tool for data analysts, who can use Excel to calculate the variance using functions like VAR.S and VAR.P. We’ll explain how to use variance functions in this step-by-step tutorial.

In mathematical terms, variance is the calculation of how far a set of values is from the average value (the mean). If the variance is zero, there isn’t any variety—all numbers are likely to be the same. As this number grows, the variance grows with it.

This has all kinds of uses for analysts, from determining the different ages in a group to working out the spread of returns in different investment portfolios. Excel allows you to calculate variance like this by using functions aimed at entire data sets (population variance) or a small subset of a larger group of data (sample variance).

This is an important distinction, as the way Excel calculates variance will differ depending on the size of your data set. If you’re working with a smaller sample, you’ll need to use VAR, VAR.S, or VARA functions to calculate variance. For population variance, you’ll need to use VARP, VAR.P, or VARPA instead.

While there are similarities between these functions, there are some important things to consider before you use them. In this article, we’ll explain:

  1. What are variance functions in Excel and what are they used for?
  2. How do variance functions work in Microsoft Excel?
  3. Things to consider before using variance functions in Excel
  4. How to calculate variance in Excel: A step by-step guide

How do variance functions work in Excel? To help you, let’s run through the basics.

1. What are variance functions in Excel and what are they used for?

Variance works by determining the spread of values against the mean. If you have a set of exam results for a group of students, you might end up with wildly different values in two separate exams, but with the same average. By determining the variance, you can determine how well the group performed as a whole.

An Excel spreadsheet containing data for student ID, student name, and exam result

You can calculate this spread (the variance) using Excel’s variance functions. As we’ve mentioned, there are two main forms of variance that you can calculate in Excel: population variance and sample variance. In this context, population is the entire set of data, rather than a sample (or smaller subset) of it.

To calculate these values, you can use one of six variance functions in Excel. For sample variance, you can use the VAR, VAR.S or VARA functions. VAR is the original function, while VAR.S is the newer replacement, offering some speed enhancements over the original.

VAR and VAR.S only support numerical values, but if you want to use text strings or logical tests for a sample set, you’ll need to use VARA instead.

For population variance, you’ll need to use the VARP, VAR.P or VARPA functions. As with the sample variance functions, VARP is the original, while VAR.P is the newer (and recommended) replacement, with both functions working only with numerical values. To work with text strings or logicals, use VARPA instead.

If you’re thinking that this sounds a lot like standard deviation, that’s because it (almost) is. Standard deviation calculates, on average, how far your values are from the mean. Variation is simply the standard deviation value squared, which gives you an idea of how far all of your numbers are spread from the average.

2. How do variance functions work in Excel?

As we’ve already mentioned, there are six variance functions that you can use in Excel, split into two categories to deal with either population or sample variation.

These are:

  • VAR, VAR.S or VARA for sample variance, and
  • VARP, VAR.P or VARPA for population variance.

Of these six, two functions (VAR and VARP) are considered outdated, having been replaced with VAR.S and VAR.P. These are interchangeable for the time being, but could be removed from Excel in the future.

An Excel spreadsheet containing data for student ID, student name, and exam result. The VARA formula has been typed into the formula bar

Four of these functions (VAR, VARP, VAR.S and VAR.P)focus on numerical data. That means that, if you’re a budding data analyst trying to work out the variance from a set of numbers using either a sample of a data set or the entire data set, you’d want to use these functions.

Should your data be mixed, however, you’ll need to use VARA or VARPA instead. These functions support text, numbers, and logical values (TRUE, FALSE, 1 or 0).

An Excel spreadsheet containing data for student ID, student name, and exam result. The VARA formula has been typed into the formula bar

By support, we mean that text strings and logical results are converted to the numerical equivalent, where a text string is counted as a 0 (or FALSE). Logical values are counted as their numerical equivalent (0 for FALSE or 1 for TRUE). This can have an impact on your overall results, so choose your functions carefully.

If you want to create a formula using any of these variance functions, you’ll need to use a set structure. The structure remains the same for each six functions:

  • =VAR(value1,value2, …)
  • =VAR.S(value1,value2, …)
  • =VARP(value1,value2, …)
  • =VAR.P(value1,value2, …)
  • =VARA(value1,value2, …)
  • =VARPA(value1,value2, **…)**

An Excel spreadsheet with the VARA function typed into the formula bar with a range of cells selected

The only required argument in a variance formula using these functions is the reference to the data you use (value1). This can be referenced as a range of cells or as values directly (where value1 is your first value, value2 is your second value, etc).

Only one value (value1) is required for a variance function to work. For cell ranges, this is considered as a single value (value1) for the purpose of creating your formula.

3. Things to consider before using variance functions in Excel

There are plenty of considerations to make before you decide to calculate variance in Excel using these functions. In particular, you’ll need to consider:

  • While VAR and VAR.S are technically interchangeable, VAR.S is the replacement Excel function for sample data sets and should be used in the first instance. Likewise, VAR.P should be used over VARP for population data sets as the newer function.
  • VAR, VAR.S, VARP and VARP only support numerical values. Other values (text strings, logical values, etc.) are ignored and won’t count towards your result.
  • If you want to count text or logical values as you calculate variance, you’ll need to use VARA (for samples) or VARPA (for population sets).
  • You can use references to cell ranges (eg. =VAR.S(A1:D10)) in your variance formulas, or reference each value separately (eg. =VAR.S(1,2,3,4)).
  • If you reference each value separately, you can use up to 254 different values. This is an Excel limitation and can’t be increased. If you require more, fill out your spreadsheet first, then use a reference to the cell range containing those cells instead.
  • Only a single argument (value1) is required, which can contain a single value or a reference to a range of cells. However, to calculate variance from a single value is redundant, so you’ll need to use more arguments if you’re typing these into your formula directly.
  • If you’re adding a text string as a value in a variance formula, you’ll need to reference it in another cell for the formula to work, as directly adding a text string as a value argument will cause a #VALUE error to appear.

If you have a small sample from a larger data set, you can use the VAR, VAR.S or VARA functions to calculate the variance. If you’re trying to calculate variance in Excel using the population data set (that is, the entire set of data, rather than the smaller sample), you can do this using VARP, VAR.P or VARPA instead.

For the purpose of this guide, references to VAR and VAR.S are interchangeable. We’ve used VAR.S, which is the newer and recommended function, but the older VAR can be used (for the time being) in older workbooks. If you can, however, use VAR.S.

Likewise, references to VARP and VAR.P are also interchangeable, but you should use VAR.P in the first instance. VARA and VARPA remain available for all Excel users, regardless of the version used.

Step 1: Select an empty cell

To insert a variance function into a new formula, start by opening the Excel workbook containing your data and selecting an empty cell. Alternatively, you can open a new workbook, making sure that the sheet containing your data remains open and minimized.

With the cell selected, press the formula bar at the bottom of the ribbon bar until you see the blinking cursor.

An Excel spreadsheet containing data for student ID, student name, and exam result. A red arrow is pointing to the formula bar, and an empty cell has been selected

When the blinking cursor is visible, you’re ready to begin inserting your new formula.

Step 2: Insert your data set directly or using cell references

As we explained earlier, all variance functions in Excel use the same structure to create new formulas. To insert a new variance function using a sample data set (a smaller sample of a larger population set), start by typing =VAR.S( or =VARA( into the formula bar at the top.

If you’re working with a population data set (the entire data set), type =VAR.P( or =VARPA( instead.

An Excel spreadsheet containing data for student ID, student name, and exam result. The VAR.P formula has been typed into the formula bar

With your formula opened, you’ll need to insert your data next. Most users will likely prefer to reference data elsewhere in your current workbook (or in a minimized workbook) using a cell range.

For instance, =VAR.S(C2:C10) or =VAR.P(C2:C20) completes the formula, using the numerical data in a cell range between cells C2 and C10 (for the sample set) or C2 and C20 (for the population set). Make sure to replace these references with your own.

If you’re working with data that contains numbers, text, and/or logical values, =VARA(C2:C10) or =VARPA(C2:C20) will work best. Rather than ignoring text or logical values (as VAR, VAR.S, VARP or VAR.P would), the values in a VARA or VARPA formula will count towards your overall result.

You could also reference each cell individually. For example =VARA(C2:C10) and =VARA(C2,C3,C4,C5,C6,C7,C8,C9,C10) will return the same result.

If you’re adding numerical values directly to your formula, you’ll need to add the values one by one. Each value needs to be separated using commas. For instance, =VAR.S(1,2,3,4,5,6) or =VAR.P(1,2,3,4,5,6,7,8,9,10) will give you the variance between the numbers 1 and 6 (or 1 and 10 for a population set) directly.

An Excel spreadsheet containing data for student ID, student name, and exam result. The VAR.S formula has been typed into the formula bar

You can also do the same with VARA or VARPA. For example, =VARA(1,2,TRUE,3) would work, with the TRUE value counting as its numerical equivalent (1). Likewise, =VARPA(1,2,TRUE,3,4,10,8) would count these values in the same way, with TRUE counting as 1.

VARA and VARPA support text, but to use these, you’ll need to use a cell reference or cell range. For instance, =VARA(1,2,TRUE,D5,3,4,10,8) or =VARA(D2:D9) would work, where D5 contains text that counts as a FALSE value (0). If you try to add a text string directly, however, Excel will return a #VALUE error.

An Excel spreadsheet containing data for student ID, student name, and exam result. The VARA formula has been typed into the formula bar

If you’ve added a reference to a cell range, make sure to close your formula with a closing parenthesis afterwards, then press enter to view the results (or click on another empty cell). For values added directly, place a closing parenthesis after the final value is inserted into your formula.

Final thoughts

By calculating the variance, you can learn a lot about the data you’re working with. This makes the life of a typical data analyst even easier, allowing you to prove theories and hypotheses using a single Excel formula. Variance functions are among the many Excel formulas that data analysts use on a regular basis to find results.

Excel makes mathematical functions like variance and standard deviation easier to handle, especially for beginners. There are also scripts on the internet that make it a little easier, such as this variance calculator—but it’s way more rewarding to learn how to calculate variance on your own!

If you’re new to the field and you want to learn more, try this free, five-day introductory data analytics course. And, if you’re keen to get to grips with more Excel formulas, check out the following:

  • How to convert text to numbers in Excel
  • How to use the SUMIF function in Excel
  • How to use the VLOOKUP function in Excel

Понравилась статья? Поделить с друзьями:
  • Variable field in word
  • Var excel что это
  • Var excel на русском
  • Vape in a word
  • Vanilla ice word to