Calculating standard deviation 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 standard deviation based on a sample. The standard deviation is a measure of how widely values are dispersed from the average value (the mean).

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 STDEV.S function.

Syntax

STDEV(number1,[number2],…)

The STDEV 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. You can also use a single array or a reference to an array instead of arguments separated by commas.

Remarks

  • STDEV assumes that its arguments are a sample of the population. If your data represents the entire population, then compute the standard deviation using STDEVP.

  • The standard deviation is calculated using the «n-1» method.

  • 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 STDEVA function.

  • STDEV 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.

Data

Strength

1345

1301

1368

1322

1310

1370

1318

1350

1303

1299

Formula

Description (Result)

Result

=STDEV(A3:A12)

Standard deviation of breaking strength (27.46392)

27.46392

Need more help?

Want more options?

Explore subscription benefits, browse training courses, learn how to secure your device, and more.

Communities help you ask and answer questions, give feedback, and hear from experts with rich knowledge.

Excel is used extensively for statistics and data analysis. Standard deviation is something that is used quite often in statistical calculations.

In this tutorial, I will show you how to calculate the standard deviation in Excel (using simple formulas)

But before getting into, let me quickly give you a brief overview of what standard deviation is and how it’s used.

What is Standard Deviation?

A standard deviation value would tell you how much the data set deviates from the mean of the data set.

For example, suppose you have a group of 50 people, and you are recording their weight (in kgs).

In this data set, the average weight is 60 kg, and the standard deviation is 4 kg. It means that most of the people’s weight is within 4 kg of the average weight (which would be 56-64 kg).

Now let’s interpret the standard deviation value:

  • A lower value indicates that the data points tend to be closer to the average (mean) value.
  • A higher value indicates that there is widespread variation in the data points. This can also be a case when there are many outliers in the data set.

Standard Deviation in Excel- Bell Curve

Calculating Standard Deviation in Excel

While it’s easy to calculate the standard deviation, you need to know which formula to use in Excel.

There are six standard deviation formulas in Excel (eight if you consider database functions as well).

there are eight standard deviation functions in Excel

These six formulas can be divided into two groups:

  1. Calculating the sample standard deviation: The formulas in this category are STDEV.S, STDEVA, and STDEV
  2. Calculating the standard deviation for an entire population: The formulas in this category are STDEV.P, STDEVPA, and STDEVP

In almost all of the cases, you will use standard deviation for a sample.

Again in layman terms, you use the term ‘population’ when you want to consider all the datasets in the entire population. On the other hand, you use term ‘sample’ when using a population is not possible (or it’s unrealistic to do so). In such a case, you pick a sample from the population.

You can use the sample data to calculate the standard deviation and infer for the entire population. You can read a great explanation of it here (read the first response).

So. this narrows down the number of formulas to three (STDEV.S, STDEVA, and STDEV function)

Now let’s understand these three formulas:

  • STDEV.S – Use this when your data is numeric. It ignores the text and logical values.
  • STDEVA – Use this when you want to include text and logical values in the calculation (along with numbers). Text and FALSE are taken as 0 and TRUE is taken as 1.
  • STDEV – STDEV.S was introduced in Excel 2010. Before it, the STDEV function was used. It is still included for compatibility with prior versions.

So, you can safely assume that in most of the cases, you would have to use STDEV.S function (or STDEV function if you’re using Excel 2007 or prior versions).

So now let’s see how to use it in Excel.

Using STDEV.S Function in Excel

As mentioned, STDEV.S function uses numerical values but ignores the text and logical values.

Here is the syntax of STDEV.S function:

STDEV.S(number1,[number2],…)

  • Number1 – This is a mandatory argument in the formula. The first number argument corresponds to the first element of the sample of a population. You can also use a named range, single array, or a reference to an array instead of arguments separated by commas.
  • Number2, … [Optional argument in the formula] You can use up to 254 additional arguments. These can refer to a data point, a named range, a single array, or a reference to an array.

Now, let’s have a look at a simple example where we calculate the standard deviation.

Example – Calculating the Standard Deviation for Weight Data

Suppose you have a data set as shown below:

Weight Data to Calculate Standard Deviation in Excel

To calculate the standard deviation using this data set, use the following formula:

=STDEV.S(A2:A10)

In case you’re using Excel 2007 or prior versions, you will not have the STDEV.S function. In that case, you can use the below formula:

=STDEV(D2:D10)

Using STDEVS function to find deviation in weight


The above formula returns the value of 2.81, which indicates that most of the people in the group would be within the weight range 69.2-2.81 and 69.2+2.81.

Note that when I say ‘most of the people’, it refers to the normal distribution of the sample (that is 68% of the sample population is within one standard deviation from the mean).

Also, note that this is a very small sample set. In reality, you may have to do this for a bigger sample data set where you can observe normal distribution better.

Hope you found this Excel tutorial useful.

You May Also Like the Following Excel Tutorials:

  • Calculating Weighted Average in Excel.
  • Calculating CAGR in Excel.
  • Calculate and Format Percentages in Excel.
  • Calculate Age in Excel using Formulas.
  • Creating a Bell Curve in Excel.
  • Calculating Compound Interest in Excel.
  • How to Calculate Square Root in Excel
  • Calculate the Coefficient of Variation (CV) in Excel
  • How to Calculate Correlation Coefficient in Excel
  • How to Get Descriptive Statistics in Excel?


Download Article

Step-by-step tutorial for the STDEV functions


Download Article

This wikiHow shows you how to find the standard deviation of a dataset in Microsoft Excel. Whether you’re studying for statistics, analyzing data at work, or just researching something for fun, calculating a standard deviation is essential. And, it’s pretty easy to do in Excel! There are built-in functions for calculating the standard deviation.

Things You Should Know

  • There are four functions for calculating standard deviation.
  • STDEV.P and STDEV.S cover most situations. Use STDEV.P for populations and STDEV.S for samples.
  • The function will calculate the standard deviation for a selected range of cells.

Steps

  1. Image titled Calculate Standard Deviation in Excel Step 1

    1

    Enter the values you want to use. Pick a column in which you want to enter your data, then type each data value into individual cells in that column. Using Excel is a great way to organize and analyze your data.

    • For example, if you select column «A» as the area in which to enter your data, you might type a number into cell A1, cell A2, cell A3, and so on.
    • If needed, you can move columns in your spreadsheet to organize your data.
  2. Image titled Choose a Recruitment Agency Step 21

    2

    Note this information about the different functions. There are four functions in Excel for calculating standard deviation. The functions differ in two ways:[1]

    • The selected function will either calculate the standard deviation for a sample (using n — 1) or a population (using n), where n is the sample size.
    • The selected function will include or exclude logical values (TRUE and FALSE) and text (numbers represented as text). TRUE is interpreted as a 1, while FALSE is 0.

    Advertisement

  3. Image titled Start a New Day Step 16

    3

    Choose a standard deviation function. Here are the four options for calculating standard deviation:

    • STDEV.P — Finds the standard deviation of a population. This function doesn’t include logical values or text.[2]
    • STDEV.S — Finds the standard deviation of a sample. This function doesn’t include logical values or text.[3]
    • STDEVA — Finds the standard deviation of a sample. This function does include logical values or text.[4]
    • STDEVPA — Finds the standard deviation of a population. This function does include logical values or text.[5]
    • There are also two outdated functions that have been replaced by the above functions. They are still present in Excel for backward compatibility reasons, but may be phased out in future versions.
      • STDEV — This function was replaced by STDEV.S. Finds the standard deviation of a sample. This function doesn’t include logical values or text.[6]
      • STDEVP — This function was replaced by STDEV.P. Finds the standard deviation of a population. This function doesn’t include logical values or text.[7]
  4. Image titled Calculate Standard Deviation in Excel Step 4

    4

    Click a blank cell. This should be the cell in which you want to display the standard deviation value. Doing so selects the cell.

  5. Image titled Calculate Standard Deviation in Excel Step 5

    5

    Type in the standard deviation function. In the cell you selected, enter the standard deviation function you want to use. Here is STDEV.S() as an example:

    • =STDEV.S()
  6. Image titled Calculate Standard Deviation in Excel Step 6

    6

    Add your value range. To do so:

    • In between the parentheses, type the letter and number of the cell containing your first data value.
    • Type a colon (:)
    • Type the letter and number of the last cell.
    • For example, if you entered your data in column «A» from rows 1 through 10, you would have =STDEV.S(A1:A10) typed here.
    • If you just want to display the standard deviation of the value of a few scattered cells such as A1, B3, and C5, you can type the cell names separated by commas (e.g., =STDEV.S(A1,B3,C5)).
  7. Image titled Calculate Standard Deviation in Excel Step 7

    7

    Press Enter. This will prompt Excel to run the formula, displaying the standard deviation of the selected cells in the formula’s cell.

    • If you want to check your work, you can calculate the standard deviation by hand.
  8. Advertisement

Add New Question

  • Question

    How do I use Excel to calculate 2 standard deviations?

    Community Answer

    Use =STDEV(), and put your range of values in the parentheses. This can be 2 cells or 2 values (numbers).

Ask a Question

200 characters left

Include your email address to get a message when this question is answered.

Submit

Advertisement

Video

Thanks for submitting a tip for review!

Advertisement

  • The old =STDEV( ) formula doesn’t work in versions of Excel older than 2007.

Advertisement

References

About This Article

Thanks to all authors for creating a page that has been read 443,657 times.

Is this article up to date?

wikiHow Tech Help Pro:

Level up your tech skills and stay ahead of the curve

Let’s go!

The standard deviation shows the variability of the data values from the mean (average). In Excel, the STDEV and STDEV.S calculate sample standard deviation while STDEVP and STDEV.P calculate population standard deviation. STDEV is available in Excel 2007 and the previous versions. However, STDEV.P and STDEV.S are only available in Excel 2010 and subsequent versions.

Table of contents
  • What is Standard Deviation in Excel?
    • Standard Deviation Formulas in Excel
      • The Syntax of STDEV.S Function
      • The Population vs. Sample
      • The STDEV.S and STDEVA Functions
    • Calculating Standard Deviation in Excel
      • #1 – Calculate Population Standard Deviation in Excel
      • #2– Calculate Sample Standard Deviation in Excel
    • Frequently Asked Questions
    • Recommended Articles

Standard Deviation Formulas in Excel

In excel, there are eight formulas to calculate the standard deviation. These are grouped under sample and population.

The functions STDEV.S, STDEVA, STDEV, DSTDEV are under sample and STDEV.P, STDEVP, STDEVPA, DSTDEVP are under population.

Standard Deviation in excel Example 1

The Syntax of STDEV.S Function

The syntax of the function is stated as follows:

Standard Deviation - STDEV.s Formula

The function accepts the following arguments:

  • Number 1: This is the first value of the sample data. It can be expressed as a range.
  • Number 2: This is the second value of the sample data.

“Number 1” is mandatory and “number 2” is an optional argument.

Note 1: If the entire sample data is entered as a range, the “number 2” argument becomes optional.

Note 2: The sample standard deviation formula works correctly when the supplied arguments contain at least two numeric values. Otherwise, it returns the “#DIV/0!” error.

The Population vs. Sample

The population and sample are defined as follows:

  • The population refers to the whole data set.
  • A sample is a subset of the data set. A sample of the population is taken when it is difficult to use the complete data set.

Note: The sample standard deviation helps make conclusions for the population.

The STDEV.S and STDEVA Functions

The two functions are explained as follows:

  • The STDEV.S function calculates the standard deviationStandard deviation (SD) is a popular statistical tool represented by the Greek letter ‘σ’ to measure the variation or dispersion of a set of data values relative to its mean (average), thus interpreting the data’s reliability.read more using the numerical values. It ignores the text values. The “S” of the function represents the sample data set.
  • The STDEVA function calculates the standard deviation by counting the text values as zero. The logical value “false” is counted as 0 and “true” is counted as 1.

Note: The STDEV.S is available in Excel 2010 and the subsequent versions.

Calculating Standard Deviation in Excel

#1 – Calculate Population Standard Deviation in Excel

Let us consider an example to understand the concept of standard deviation in Excel.

The following are the employee scores of an organization. They indicate the skill levels of the employees.

We want to calculate the standard deviation of the given data set.

Standard Deviation Example 1

The steps to calculate standard deviation in Excel are listed as follows:

  1. Calculate the mean (average) of the data.

    Standard Deviation Example 1-1

    The output 55.2 signifies the average employee score.

    Standard Deviation Example 1-2

  2. Calculate the population variance. It is the difference of each score from the mean. The results are summed as shown in the following image.

    Variance =
    Standard Deviation Example 1-3
    Variance =
    Standard Deviation Example 1-4

    The population variance is 3.36.

  3. Calculate the standard deviation. It is the square root of the variance.

    Standard Deviation Example 1-5

    Conclusion: The standard deviation is 1.83. This indicates that the employee scores range from 53.37 to 57.03.

#2– Calculate Sample Standard Deviation in Excel

Let us consider an example to understand the working of the STDEV.S function.

The following table shows the heights of different goats. The height is measured from the shoulder level and is denoted in millimeters.

You can download this Standard Deviation Excel Template here – Standard Deviation Excel Template

STDEV.S Example 1-1

Step 1: Calculate the mean of the given data. The output is 394.

STDEV.S Example 1-2

Step 2: Apply STDEV.S to the range B2:B6. The output is 165.

STDEV.S Example 1-3

Conclusion: The standard deviation of the height of the goats is 165. This indicates that the usual heights are within the range of 229 and 559 millimeters.

In other words, the heights are on either side of the mean, i.e., 394–165=229 and 394+165=559.

STDEV.S Example 1-4

Frequently Asked Questions

1. What is standard deviation in Excel?

The standard deviation measures the dispersion of a given set of values from the mean. It shows the fluctuation of data values. A low standard deviation indicates lower variability and greater accuracy of the mean. On the other hand, a high standard deviation indicates higher variation and lesser reliability of the mean.

While investing, the standard deviation of the returns is evaluated to assess the volatility of a stock. In Excel, the STDEV and STDEV.S calculate sample standard deviation while STDEVP and STDEV.P calculate population standard deviation.

2. Which standard deviation formula should be used in Excel?

To select the appropriate standard deviation formula, the following points must be considered:
• The standard deviation is being calculated for a population or sample.
• The type of values of the data set. These values can be numerical, logical or textual.
• The version of MS Excel which is being used currently.

3. How to create a standard deviation graph in Excel?

The steps to create a standard deviation graph in Excel are listed as follows:
• Create a usual Excel chart with the help of the “charts” group under the Insert tab.
• Select the chart and click the plus (+) sign on the top-right corner.
• In “chart elements,” click the arrow of “error bars,” and select “standard deviation.”

The standard deviation bars for the data points are inserted within the chart.

  • STDEV calculates the standard deviation of the sample data supplied as an argument.
  • The standard deviation shows the variability of the data values from the mean (average).
  • The lower the standard deviation, the closer the data points to the mean.
  • The higher the standard deviation, the more scattered the data points from the mean.
  • The population refers to the entire data set while a sample is a subset of this data.
  • The STDEV.S function calculates the standard deviation using the numerical values only.
  • The STDEV.S function accepts two arguments–“number 1” and “number 2” representing the first and the second value of the sample data respectively.

Recommended Articles

This has been a guide to standard deviation in Excel. Here we discuss how to calculate standard deviation in excel using formula and examples. You may also look at these useful functions in Excel –

  • Quartile DeviationQuartile deviation is based on the difference between the first quartile and the third quartile in the frequency distribution and the difference is also known as the interquartile range, the difference divided by two is known as quartile deviation or semi interquartile range.read more
  • Sample Standard Deviation FormulaSample standard deviation refers to the statistical metric that is used to measure the extent by which a random variable diverges from the mean of the sample.read more
  • Standard Deviation Graph in ExcelThe standard deviation is a metric that calculates how values change when compared to or in relation to the mean or average value. Both deviations are represented in a standard deviation graph, with one being positive on the right and the other being negative on the left.read more
  • QUARTILE Function in Excel

Are you planning to learn how to calculate standard deviation in Excel? Read the article to know how to do it.

We all know that Excel makes our organizations and data storage manageable by not just the features it offers when it comes to rows and columns but much more. But some users might not really know about it and overlook the ability of Excel to make tedious tasks more efficient. 

Excel gives us features of Excel that are great to use to save time and be more productive. You just need to know what formula can be used where. Excel can definitely speed up your process.

What is the Standard Deviation?

A standard deviation value would tell you how much the data set deviates from the mean of the data set.

For example, you have a group of 50 people and are recording their weight (in kgs).

In this data set, the average weight is 60 kg, and the standard deviation is 4 kg. It means that most people’s weight is within 4 kg of the average weight (which would be 56-64 kg).

Now let’s understand the standard deviation value:

  • A lower value indicates that the data points are closer to the average (mean) value.
  • A higher value indicates that there is widespread variation in the data points. This can also be a case when there are many outliers in the data set.

Your Data Is Safe As A House

With daily backups, we ensure your data is safe and secure whether you lose your phone or it breaks down.

Calculating Standard Deviation in Excel

It is easy to calculate standard deviation but one should know which formula one must use. 

There are six standard deviation formulas in Excel 

there are eight standard deviation functions in Excel

These six formulas can be divided into two groups:

  1. Calculating the sample standard deviation: The formulas in this category are STDEV.S, STDEVA, and STDEV
  2. Calculating the standard deviation for an entire population: The formulas in this category are STDEV.P, STDEVPA, and STDEVP

You will use standard deviation for a sample in almost all cases.

You can use the sample data to calculate the standard deviation and infer for the entire population.

So, this narrows down the number of formulas to three. Now let’s understand these three formulas:

Standard Deviation Formula In Excel

  • STDEV.S – Use this when your data is numeric. It ignores the text and logical values.
  • STDEVA – Use this when you want to include text and logical values in the calculation (along with numbers). Text and FALSE are taken as 0 and TRUE is taken as 1.
  • STDEV – STDEV.S was introduced in Excel 2010. Before it, the STDEV function was used. It is still included for compatibility with prior versions.

So, you can safely assume that in most cases, you would have to use the STDEV.S function.

Using STDEV.S Function in Excel

As mentioned, the STDEV.S function uses numerical values but ignores the text and logical values.

Here is the syntax of STDEV.S function:

STDEV.S(number1,[number2],…)

  • Number1 – This is a mandatory argument in the formula. The first number argument corresponds to the first element of the sample of a population. You can also use a named range, a single array, or a reference to an array instead of arguments separated by commas.
  • Number2, … [Optional argument in the formula] You can use up to 254 additional arguments. These can refer to a data point, a named range, a single array, or a reference to an array.

Example – Calculating the Standard Deviation for Weight Data

Suppose you have a data set as shown below:

Weight Data to Calculate Standard Deviation in Excel

Use the following formula to calculate the standard deviation using this data set: 

=STDEV.S(A2:A10)

In case you’re using Excel 2007 or prior versions, you will not have the STDEV.S function. In that case, you can use the below formula:

=STDEV(D2:D10)

Using STDEVS function to find deviation in weight

The above formula returns the value of 2.81, which shows that most of the people in the group are within the weight range 69.2-2.81 and 69.2+2.81.

Track And Share Employee Database

Simple working and sharing employee database with others and keeping it safe on the cloud with Lio.

How Lio can Help You

Lio is a great platform that can help entrepreneurs, homemakers, students, businessmen, managers, shop owners, and many others. This mobile application helps to organize business data and present them in an eye-catching manner. 

Lio is a great platform for small business owners and can track a wholesome record of employee information for better employee management, customer data, etc. You can handle those data with ease.

If you want to be a professional, then you must save time, you need to learn to arrange all the business strategies in one place. In that case, Lio can be your partner.

Entrepreneurs can also allow multiple authorized users of their office to access the information from various locations within minutes.

Lio is definitely for the win and using it for your business is only going to make your journey smooth and easy to track.

Step 1: Select the Language you want to work on. Lio on Android

Choose from 10 Different Language offered by Lio

Step 2: Create your account using your Phone Number or Email Id.

Create Account using your Phone Number or Email Id in Lio

Verify the OTP and you are good to go.

Step 3: Select a template in which you want to add your data.

Choose from 60+ Templates offered by Lio And Start Adding Your Data

Add your Data with our Free Cloud Storage.

Step 4: All Done? Share and Collaborate with your contacts.

Share you files with friends and colleagues

Frequently Asked Questions (FAQs)

Do I use STDEV P or STDEV s?

The STDEV. P function is used in calculating the standard deviation for an entire population. If we wish to calculate the standard deviation of a sample population, we need to use the STDEV. S function.

Is STDEV in Excel standard deviation?

Estimates standard deviation based on a sample. The standard deviation is a measure of how widely values are dispersed from the average value.

Is STDEV A1 A10 an Excel function?

STDEVA is a function in Excel that calculates the standard deviation of a set of data. 

Conclusion

Hope by now you have understood what standard deviation in Excel is and how you can calculate it. Once you have understood it and gotten to the depth of it, you can now use it in your work and grow your business.

Download Lio App

What is Standard Deviation? | STDEV.P | STDEV.S | Variance

This page explains how to calculate the standard deviation based on the entire population using the STDEV.P function in Excel and how to estimate the standard deviation based on a sample using the STDEV.S function in Excel.

What is Standard Deviation?

Standard deviation is a number that tells you how far numbers are from their mean.

1. For example, the numbers below have a mean (average) of 10.

Standard Deviation of Zero in Excel

Explanation: the numbers are all the same which means there’s no variation. As a result, the numbers have a standard deviation of zero. The STDEV function is an old function. Microsoft Excel recommends using the new STEDV.S function which produces the exact same result.

2. The numbers below also have a mean (average) of 10.

Low Standard Deviation in Excel

Explanation: the numbers are close to the mean. As a result, the numbers have a low standard deviation.

3. The numbers below also have a mean (average) of 10.

High Standard Deviation in Excel

Explanation: the numbers are spread out. As a result, the numbers have a high standard deviation.

STDEV.P

The STDEV.P function (the P stands for Population) in Excel calculates the standard deviation based on the entire population. For example, you’re teaching a group of 5 students. You have the test scores of all students. The entire population consists of 5 data points. The STDEV.P function uses the following formula:

Formula of the Standard Deviation Based on the Entire Population

In this example, x1 = 5, x2 = 1, x3 = 4, x4 = 6, x5 = 9, μ = 5 (mean), N = 5 (number of data points).

1. Calculate the mean (μ).

Calculate the Mean

2. For each number, calculate the distance to the mean.

Distance to the Mean

3. For each number, square this distance.

Square of the Distance to the Mean

4. Sum (∑) these values.

Sum these Values

5. Divide by the number of data points (N = 5).

Divide by the Number of Data Points

6. Take the square root.

Standard Deviation Based on the Entire Population

7. Fortunately, the STDEV.P function in Excel can execute all these steps for you.

STDEV.P function in Excel

STDEV.S

The STDEV.S function (the S stands for Sample) in Excel estimates the standard deviation based on a sample. For example, you’re teaching a large group of students. You only have the test scores of 5 students. The sample size equals 5. The STDEV.S function uses the following formula:

Formula of the Standard Deviation Based on a Sample

In this example, x1=5, x2=1, x3=4, x4=6, x5=9 (same numbers as above), x̄=5 (sample mean), n=5 (sample size).

1. Repeat steps 1-5 above but at step 5 divide by n-1 instead of N.

Divide by n-1

2. Take the square root.

Standard Deviation Based on a Sample

3. Fortunately, the STDEV.S function in Excel can execute all these steps for you.

STDEV.S function in Excel

Note: why do we divide by n — 1 instead of by n when we estimate the standard deviation based on a sample? Bessel’s correction states that dividing by n-1 instead of by n gives a better estimation of the standard deviation.

Variance

Variance is the square of the standard deviation. It’s that simple. Sometimes it’s easier to use the variance when solving statistical problems.

1. The VAR.P function below calculates the variance based on the entire population.

VAR.P function in Excel

Note: you already knew this answer (see step 5 under STDEV.P). Take the square root of this result to find the standard deviation based on the entire population.

2. The VAR.S function below estimates the variance based on a sample.

VAR.S function in Excel

Note: you already knew this answer (see step 1 under STDEV.S). Take the square root of this result to find the standard deviation based on a sample.

3. VAR and VAR.S produce the exact same result.

VAR function in Excel

Note: Microsoft Excel recommends using the new VAR.S function.

In statistics, Standard Deviation is used to find how far each value in a data set varies from the mean or average value. This helps us understand how closely each number is clustered around the mean.

There are several types of professionals who use standard deviation as a fundamental risk measure, such as Insurance analysts, portfolio managers, Statisticians, Market researchers, Real estate agents, stock investors, etc.

However, calculating Standard Deviation in Excel can be a daunting process for those who are new to Excel or aren’t familiar with it. That is why, in this article, we are going to explain what Standard Deviation is and how to calculate it in Excel.

What is Standard Deviation?

The mean value indicates the average value in the data set. And the Standard Deviation represents the difference between the values of the data set and their average value. In other words, standard deviation tells you whether your data is close to the mean or varies a lot.

For example, if a teacher were to tell you that the average score of her students is 60 (mean). And if you have the list of her students’ scores, you can use standard deviation to find out how accurate she is.

There are two types of Standard deviations: population standard deviation and sample standard deviation. The sample standard deviation (SSD) is calculated from the random samples of the population or data while population standard deviation (PSD) is calculated from the entire population data.

The higher the standard deviation, the more spread out the data is from the mean, and the lower the standard deviation, the closer the values are to the average/mean. If the standard deviation is 0, all the data points in the data set are equal. Also, a higher standard deviation means the mean is less accurate, and a lower standard deviation indicates the mean is more reliable.

There are two different ways for calculating Standard Deviation in Excel using formulas or built-in functions.

Population vs. Sample

Sample calculations are common because sometimes it’s not possible to calculate the entire data set. Before you start calculating standard deviation, you must know what kind of data you have – entire data or sample of the data. Because you have to use different formulas and functions for sample and population data.

  • Population data refers to the entire data set. It means the data is available for all the members of a group. The population standard deviation calculates the distance of each value in a data set from the population mean. An example of population data is a census.
  • Sample data on other hand is the subset of the population. It is a subset that represents the entire population. The sample is a smaller group of data that is derived from the population. Sample data is used when the entire population is not available or it is enough for statistics. A good example of a sample is a survey.

Calculate Standard Deviations using Manual Calculations

Manually calculating standard deviations is a bit of a lengthy process, but can be easily done using formulas. First, you need to calculate the variance of data and then find the square root of the variance.

Population Standard Deviation

The formula for calculating the population standard deviation is given below: 

Where

  • μ is the arithmetic mean
  • Xi is individual values in the set of data
  • N is the total number of X values (population) in the data set

Sample Standard Deviation

The formula for calculating the sample standard deviation is given below: 

Where

  • μ is the arithmetic mean
  • Xi is individual values in the sample data set
  • N is the total number of X values (sample) in the data set

When calculating sample standard deviation, only the sample of the data set is considered from an entire data set. Hence, Bessel’s correction (N-1) is used instead of N to give a better estimation of the standard deviation.

To calculate the standard deviation for the below data set, follow these steps:

1. Calculate the Mean (Average)

First, you need to calculate the mean/average (μ) of all values in the data set. To do that, you add up all the values and then divide the sum by the count of the values in the data set. You can find the average using the manual arithmetic expression:

96+69+99+57+35+89+55+93+41+21/10=65.5

You can also use the AVERAGE function in Excel to calculate the mean:

=AVERAGE(B2:B11)

Here, B2:B11 in the formula represents the cells (denoted as the column number followed by the row number) that hold the data for which we intend to calculate the mean. Replace these values with the cells in your sheet while using the formula.

2. For Each Number, Calculate the Distance to the Mean:

After that, you need to find the deviation or distance to the mean by subtracting the Mean from each value in the data set. To do that, enter the below formula:

=B2-$B$13

or

=(B2-AVERAGE(B2:B11))

$B$13 is the mean of the data. The above formula is entered in cell D2 and then applied to the whole column by dragging it downwards to find the deviation for the whole column (D2:D13). Place your cursor at the bottom-right corner of the cell, here D2. A ‘+’ symbol will appear; drag it downward.

3. Square the difference

Now, square the difference for each value by using the below formula:

=D2^2

Then apply the formula to the whole column by dragging it downward. Squaring the difference will also turn the negative values into positive values.

4. Sum the Squared Differences

Next, sum all the squares of the deviation about the mean (Xi-μ)2. Here’s the formula for adding up the squared differences:

=SUM(E2:E11)

If you have large data set, you can calculate the count of values by:

=B14/10

5. Calculate the Variance

To calculate the variance, you need to divide the squared difference by the number of values.

So far, the steps for calculating sample and population standard deviation were the same. In this step, the formulas are going to change a little for both standard deviations, as explained before.

For sample variance, you need to divide the sum of squared differences by the number of values minus 1:

=B14/(10-1)

or

=SUM(E2:E11)/(COUNT(B2:B11)-1)

You can use either of the formulas to calculate sample variance.

For population variance, you need to divide the sum of squared differences by just the number of values:

=B14/10

or

=SUM(E2:E11)/(COUNT(B2:B11)

6. Get the Square Root of the Variance

Finally, you need to take a square root of the above variance to get the Standard Deviation.

Sample Standard deviation:

To get the sample standard deviation, take the square root of the sample variance:

=SQRT(B15)

or

=SQRT(SUM(E2:E11)/(COUNT(B2:B11)-1))

Population Standard Deviation:

To get population standard deviation, calculate the square root of the population variance:

=SQRT(B16)

or

=SQRT(SUM(E2:E11)/COUNT(B2:B11))

Calculate the Standard Error in Excel

The standard error of the mean or simply the standard error is another measure of variability, very similar to standard deviation, yet different. It is a measure of how far each population means is likely to be from a sample mean.

The difference between standard error and the standard deviation is that standard error uses statistics (sample data) while standard deviation uses parameters (population data). The Standard Deviation usually measures the variability within a single sample while Standard Error measures variability across multiple samples of a population. Here’s how you can calculate Standard Error (SE):

The general formula for standard error is the standard deviation divided by the square root of the number of values in the data set.

= Sample Standard Deviation / Square root of number of values (n)

To calculate Standard Error (SE), enter the below formula:

=STDEV(B2:B11)/SQRT(COUNT(B2:B11))

Here, STDEV(B2:B11) finds the standard deviation of the sample (B2:B11), and the SD is divided by the square root of the number of values (n) in B2:B11. Instead of COUNT(B2:B11), you can also directly type in the number of values in the data set (10).

Calculate the Standard Deviation using Excel Built-in Functions

Microsoft Excel includes six different functions for calculating standard deviation. These functions make it extremely easy to calculate the Standard Deviation in Excel, cutting down on the time you need to spend on the calculations. The only catch is that you need to know which function to use when. The function you need to use depends upon the data you have – sample or population.

When you type =STDEV in a blank Excel cell, it will show you the following six versions of the standard deviation functions:

  • STDEV: It is used for calculating the standard deviation for sample data. This function is the oldest Excel function (before Excel 2007) for finding standard deviation. This still exists in the latest Excel versions for compatibility purposes.
  • STDEVP: This is another older version of the standard deviation that exists for compatibility with Excel 2007 and earlier. It calculates standard deviation based on the population data.
  • STDEV.S: This is a newer version of the STEDV function (available since Excel 2010). It is used for calculating the standard deviation for sample data.
  • STDEV.P: This is a newer version of the STEDVP function in Excel (available since Excel 2010). It is used for calculating the standard deviation for entire population data.
  • STDEVA: This formula calculates the sample standard deviation of a dataset by including text and logical values. It is very similar to STDEV.S. All FALSE values and Text values are taken as ‘0’ and TRUE is taken as ‘1’. 
  • STDEVPA: This formula calculates the population standard deviation by including text and logical values. It is similar to STDEV.P. All FALSE values and Text values are taken as ‘0’ and TRUE is taken as ‘1’. 

STDEV, STDEVP, STDEV.S, STDEV.P ignores the text and logical (TRUE or FALSE) values in the dataset. In most cases, you will only need STDEV.P or STDEV.S to perform standard deviation calculations.

To give you a better understanding, here’s a summary of the six functions:

Function name Standard Deviation Handling of Logical & Text values Excel version
STDEV.S Sample standard deviation Ignored 2010 – 2021
STDEV.P Population standard deviation Ignored 2010 – 2021
STDEV Sample standard deviation Ignored 2003 – 2021
(Available for compatibility with 2007 and earlier)
STDEVP Population standard deviation Ignored 2003 – 2021
(Available for compatibility with 2007 and earlier)
STDEVA Sample standard deviation Evaluated (TRUE=1, FALSE=0, Text = 0) 2003 – 2021
STDEVPA Population standard deviation Evaluated (TRUE=1, FALSE=0, Text = 0) 2003 – 2021

Excel STDEV.P Function for Population Standard Deviation

If your data set represents the entire population, you can use the STDEV.P function to calculate the population standard deviation.

The syntax for the STDEV.P function is:

=STDEV.P(number1,[number2],…)

Where

  • number1 is the first number argument that corresponds to the first data point of the population data.
  • [number2],.. is the second number argument that corresponds to the second data point of the population data and so on.

The function must contain two or more values in the arguments and the function can take up to 255 numeric arguments. You can input numbers, arrays, and cell references as arguments.

Example:

=STDEV.P(B2:B11)

Here, B2:B11 is the range of cells that contains the population data. The above formula will return the standard deviation for the given population. As you can see, we get exactly the same result 26.58289 (population standard deviation) as the above manual method. This function automatically performs all the step-by-step calculations from the above manual method in the background and gives you the result.

In case your data contains any boolean values (TRUE or FALSE) or text values, this function ignores those values and calculates the standard deviation with the remaining values.

As you can see below, the same above formula produced a different result because it ignored the values in the cells B8 and B11.

Excel STDEV.S Function for Sample Standard Deviation

If your data set represents the sample population, you can use the STDEV.S function to calculate the sample standard deviation. For example, you have conducted a test for a large number of students but you only have a test score of 10 students, so you can use STDEV.S to find the sample standard deviation and apply it to the entire population.

The syntax for the STDEV.S function is:

=STDEV.S(number1,[number2],…)

Where

  • number1 is the first number argument corresponding to the first data point of the sample data.
  • [number2],… is the second number argument that corresponds to the second data point of the sample data and so on.

You can input numbers, arrays, and cell references as arguments.

Example:

=STDEV.S(B2:B11)

The above formula sums up all the squares of the deviation about the mean and divides it by the count minus 1 (n-1) in the background and returns the below result.

STDEV.S function also ignores the text and logical values if there are any in the data set as shown below.

Excel STDEVA Function for Sample Standard Deviation

The STDEVA is another function used to calculate the standard deviation for a sample, but it differs from the STDEV.S only in the way it handles logical and text values.

In all the above functions, logical values and text values are ignored, but the STDEVA function converts those values into 1s and 0s.

  • The logical values TRUE are counted as ‘1’ and FALSE are counted as ‘0’. The values can be contained within cells, arrays, or entered directly into the function as arguments.
  • All text strings including empty strings (“”), text representations of numbers, and any other text are evaluated as ‘0’.

To evaluate the standard deviation for a sample, including logical values and text, use this formula:

=STDEVA(B2:B11)

If there are no logical or text values in the data set, it will return the usual standard deviation.

Excel STDEVPA Function for Population Standard Deviation

Excel also has a function called STDEVPA for calculating standard deviation for a population by including text and logical values. This function is similar to the STDEVA in handling text and boolean values.

  • The logical values TRUE are counted as ‘1’ and FALSE are counted as ‘0’.
  • All text strings including empty strings (“”), text representations of numbers, and any other text are evaluated as ‘0’.

To evaluate standard deviation for a population, including logical values and text, use the below formula:

=STDEVPA(B2:B11)

Excel STDEV Function

Excel’s STDEV Function is very similar to the STDEV.S function, it can calculate the standard deviation for sample data. If you are working in Excel 2007 or earlier version, you need to use the STDEV function to calculate the standard deviation.

Syntax for STDEV function:

=STDEV(number1, [number 2],...)

Example:

=STDEV(B2:B11)

STDEV function exists in the newer versions of Excel for compatibility purposes which means it will be removed in the future. So, Microsoft is recommending that users use STDEV.S instead of STDEV.

Excel STDEVP Function

Excel’s STDEVP Function works exactly the same way as the STDEV.P function. If you are working in Excel 2007 or earlier version, you have to use the STDEVP function to calculate the standard deviation for population data.

The Syntax for STDEVP function:

=STDEVP(number1, [number 2],...)

Example:

=STDEVP(B2:B11)

STDEVP may also be removed from the future Excel version.

Calculate Standard Deviation in Excel Using Insert Function

If all these functions are hard to remember, you can use the Insert Function option to quickly calculate the standard deviation. Also, you can avoid errors while writing the formula by using the Insert function feature to automatically insert the desired formula in your chosen result cell. Here’s how you can do that:

First, select the cell where you want the output. Then, go to the ‘Formulas’ tab and select the ‘Insert Function’ button in the ribbon.

This will open the Insert Function dialog box. There, search for ‘Standard Deviation’ in the ‘Search for a function’ field or choose the ‘Statistical’ category from the ‘Or select a category’ drop-down, and click ‘Go’.

Then, scroll down the list of functions within the ‘Select a function’ window, choose a standard deviation function (STDEV.P,  STDEV.S, STDEVA, or STDEPA), and click ‘OK’.

This will open up Function Arguments dialog windows with two fields Number 1 and Number 2. In the Number 1 field, enter the range for which you want to calculate the standard deviation. Or, click the upward-facing arrow in the text field and highlight the range from the worksheet. Each number argument can only take up to 255 cell counts. If the number of cells exceeds 255, you can use Number 2, Number 3, etc.

Then, click ‘OK’.

Once you click OK, it will calculate the standard deviation using the selected function and show you the result in the cell you originally selected.

Get Standard Deviation using Data Analysis Tool in Excel

You can also get standard deviation as part of the Descriptive Statistics summary of your data using the data analysis tool. Excel’s Data Analysis tool can automatically generate various key statistical values, including mean, median, Variance, standard deviation, standard error, etc.

For the below data set, we want to calculate descriptive statistics. Here’s how you can do that:

To get Descriptive Statistics, go to the ‘Data’ tab and click the ‘Data Analysis’ tool from the Analysis section.

In the Data Analysis dialog window, select ‘Descriptive Statistics’ under Analysis Tools and click ‘OK’.

This will open the Descriptive Statistics dialog box in which you need to configure the Input and Output options.

Input Options

First, enter the range of variables/values you want to analyze in the ‘Input Range’ field.

You can manually enter the range in the field or click the upward-facing arrow button at the end of the field to choose a range.

After that, select the range from the sheet and click the downward arrow button to confirm the range.

Next, choose how you want to organize your variables (rows or columns). Here, we are selecting ‘Columns’ because our input range is in columns.

If you selected or entered the range (in the Input Range) with headers, you should tick the ‘Labels in first row’ option.

Output Options:

In the ‘Output Range’ field, enter the range where you want to display the statistical result. If you want to display the result in the current worksheet or another worksheet in the current workbook, click the ‘Output Range’ radio button and specify the range in the field next to it.

If you want to show the results in a new spreadsheet, simply select the ‘New Worksheet Ply’ radio button. Or, if you want to display the results in a new workbook, select the ‘New Workbook’ option.

Finally, check the ‘Summary statistics’ option and click ‘OK’.

And you will get all the necessary statistics you want including Standard Error, Standard Deviation, Sample Variance, etc.

How to Calculate Standard Deviation with an IF Criteria

Besides the above-mentioned six Standard Deviation functions, Excel also has two more functions called DSTDEV and DSTDEVP for calculating standard deviation with an IF condition.

  • DSTDEV function is used for calculating the standard deviation of data that is extracted from the sample data set matching the given criteria.
  • DSTDEVP function is used for calculating the standard deviation of data that is extracted from the population data set matching the given criteria.

DSTDEV Function for Sample Standard Deviation

The syntax for the DSTDEV function:

=DSTDEV(database, field, criteria)
  • Database – The range of cells (table) where the data entries with values you want to calculate standard deviation are from. The range must include headers in the first row.
  • Field: This specifies the field or column where the numbers you want to calculate the standard deviation are located. You need to specify the field name (i.e. column label or header) enclosed in double quotes or field number (i.e. column number) within the table.
  • Criteria: The range of cells that contains where your criteria are. The criteria range must contain at least one column label matching your database headers and one cell below the column label that specifies the condition from the column. It can include multiple rows to specify multiple conditions.

Example:

Suppose you have the below dataset where you need to calculate standard deviation based on conditions:

Example:

For example, to find the sample standard deviation of scores obtained in math subject by all students, enter either of the below formulas:

=DSTDEV(A1:E14,"Score",G1:H2)

or

=DSTDEV(A1:E14,5,G1:H2)

The above formula finds all the scores corresponding to Math and calculates the standard deviation for those scores. You need to create a separate criteria range (G1:H2) as shown below and enter the formula in an empty cell.

DSTDEVP Function for Population Standard Deviation

The syntax for the DSTDEVP function:

=DSTDEVP(database, field, criteria)

Where

  • Database – The range of cells (table) where the data entries with values you want to calculate standard deviation are from.
  • Field: This specifies the field or column where the values you want to calculate the standard deviation are located.
  • Criteria: The range of cells that contains where your criteria are.

Example 1:

For example, to find the population standard deviation of scores obtained in math subject by all students, enter the below formulas:

=DSTDEVP(A1:E14,"Score",G1:H2)

Example 2:

To find the population standard deviation of scores obtained in the math subject by students who are 14 and older, enter the below formula:

=DSTDEVP(A1:E14,"Score",G1:I2)

Wildcards

You can also use the following wildcards in the text related criteria to calculate standard deviation:

  • * – Matches any character with any amount
  • ? – Matches any single character
  • ~ – Finds * or ? character in the search.

Multiple-row Criteria

You can include more than one row or column in the criteria range to calculate standard deviation using OR or AND logic. If you add more than one row in the criteria range, the functions will use OR logic (TRUE if at least one of the conditions is TRUE) to calculate the standard deviation. Whereas if you add more than one column in the criteria range, the functions will use the AND logic (TRUE if all of the conditions are TRUE) to evaluate.

=DSTDEV(A1:E14,"Score",G1:G3)

Calculate Weighted Standard Deviation in Excel

Normally, when we calculate a standard deviation for a data set, all the values in the data set carry equal weights or importance. However, in some cases, each value has a different weight in the data set and some values have higher weights than others because some values are more important than others.

In such cases, you cannot use the above built-in functions to calculate the standard deviation. So, you need to use other SUM, SUMPRODUCT, and SQRT functions to calculate the weighted standard deviation manually. Let us see how to calculate weighted standard deviation in Excel.

Suppose you have a dataset where the first column contains data values and the second column contains weights of each of those values:

First, you need to calculate the weighted mean or average for the given data. You can do that with the following formula:

=SUMPRODUCT(value_range, weight_range)/SUM(weight_range)

Where,

  • value_range – Range or array of numbers.
  • weight_range – Range cells with weights

Example:

=SUMPRODUCT(A2:A10, B2:B10)/SUM(B2:B10)

In the above formula, the SUMPRODUCT function multiplies each of the values (column A) with its weight (column B) and sums up the results. Then, the SUMPRODUCT result is divided by the sum of the data weights to produce the weighted mean.

Once you have the weighted mean, you can calculate the weighted standard deviation.

To calculate the standard deviation for population data, enter the below formula:

=SQRT(SUMPRODUCT((value_range - weighted_mean)^2, weight_range)/SUM( weight_range))

Example:

=SQRT(SUMPRODUCT((A2:A10-B12)^2, B2:B10)/SUM(B2:B10))

In the above formula, the calculated weighted mean is subtracted from each data value (column A) and each result is squared. After that, each square result is multiplied by data weight (column B) using the SUMPRODUCT function.

Then, the SUMPRODUCT result is divided by the SUM of the weights. After that, the square root of the result is calculated using the SQRT function to find the standard deviation value.

To calculate the standard deviation for sample data, enter the below formula:

=SQRT(SUMPRODUCT((value_range - weighted_mean)^2, weight_range)/SUM( weight_range)-1)

Example:

=SQRT(SUMPRODUCT((A2:A10-B12)^2, B2:B10)/SUM(B2:B10)-1)

The only difference in this formula from the above formula is that we added ‘-1’ to the sum of weight for the population data.

Add Standard Deviation Bars In Excel

You can also add standard deviation bars to visualize the margin of your standard deviation using Excel error bars. Excel errors are part of the chart elements that let you represent data variability and measurement. To add standard deviation bars to your chart, follow these steps:

First, create a chart or graph for your data set. To do that, select the range of cells, go to the ‘Insert’ tab and choose a graph option from the Charts group.

Once the chart is inserted, select the graph by clicking anywhere on the graph, then click the ‘Chart Elements’ (+) button.

Then, click the ‘Error Bars’ option and select ‘Standard Deviation’.

As a result, the standard deviation bars will be inserted for all data points as shown below.

Calculating Variance in Excel

When calculating the standard deviation of your data, you often need to calculate variance as well. Variance is the variability in the data which is also the square of the standard deviation. Similar to standard deviation, it also has 6 built-in functions that you can use to calculate the variance of your data. But, Microsoft recommends users to use VAR.S and VAR.P to calculate the variance of the sample data and population data respectively.

To calculates the variance based on the sample data, use the below formula:

=VAR.S(B2:B15)

The above formula calculates sample variance for the range B2:B15 and displays the result in cell E2.

To calculates the variance based on the population data, use the below formula:

=VAR.P(B2:B15)


That’s it. That’s the only crash course you’ll ever need for calculating Standard Deviation in Excel. Now, go on and show off your newly acquired skills!

In this guide, I will show you how to calculate the mean (average), standard deviation (SD) and standard error of the mean (SEM) by using Microsoft Excel.

Calculating the mean and standard deviation in Excel is pretty easy. These have built-in functions already available.

Calculating the standard error in Excel, however, is a bit trickier. There is no formula within Excel to use for this, so I will show you how to calculate this manually.

How to calculate the mean value in Excel

The mean, or average, is the sum of the values, divided by the number of values in the group.

To calculate the mean, follow the steps below.

1. Click on an empty cell where you want the mean value to be.

2. Enter the following formula.

=AVERAGE(number1:number2)

Then change the following:

  • Number1 – the cell that is at the start of the list of values
  • Number2 – the cell that is at the end of the list of values

You can simply click and drag on the values within Excel instead of typing the cell names.

How to calculate mean in Excel

3. Then press the ‘enter’ button to calculate the mean value.

How to calculate the standard deviation in Excel

The standard deviation (SD) is a value to indicate the spread of values around the mean value.

To calculate the SD in Excel, follow the steps below.

1 Click on an empty cell where you want the SD to be.

2. Enter the following formula

=STDEV(number1:number2)

Then, as with the mean calculation, change the following:

  • Number1 – the cell that is at the start of the list of values
  • Number2 – the cell that is at the end of the list of values

How to calculate standard deviation in Excel

3. Then press the ‘enter’ button to calculate the SD.

How to calculate the standard error in Excel

The standard error (SE), or standard error of the mean (SEM), is a value that corresponds to the standard deviation of a sampling distribution, relative to the mean value.

The formula for the SE is the SD divided by the square root of the number of values n the data set (n).

To calculate the SE in Excel, follow the steps below.

1. Click on an empty cell where you want the SE to be.

2. Enter the following into the cell:

=STDEV(number1:number2)/SQRT(COUNT(number1:number2))

Change the following throughout:

  • Number1 – the cell that is at the start of the list of values
  • Number2 – the cell that is at the end of the list of values

It is worth noting that instead of using the COUNT function, you can simply type in the number of values in the data set. In this example, this would be 9.

How to calculate standard error in Excel

3. Then press the ‘enter’ button to calculate the SE.

Conclusion

In this tutorial, I have described how to calculate the mean, SD and SE by using Microsoft Excel.

Microsoft Excel version used: Office 365 ProPlus

Понравилась статья? Поделить с друзьями:
  • Calculating percentages with excel
  • Can columns be sorted in excel
  • Calculating month in excel
  • Can click button in excel
  • Calculating formulas for excel