To calculate standard deviation in Excel, you typically use either =STDEV.S() for a sample or =STDEV.P() for a population , applied to the range of cells containing your data.

How to Calculate Standard Deviation in Excel

1. Quick step‑by‑step (sample data)

Use this when your data is a sample from a larger group (which is the most common case in practice).

  1. Enter your data in a single column or row (for example, A1:A10).
  1. Click an empty cell where you want the standard deviation to appear.
  1. Type:
    =STDEV.S(A1:A10)

  2. Press Enter – Excel returns the sample standard deviation.

Example:
If test scores are in cells B1:B5, use: =STDEV.S(B1:B5).

2. When to use STDEV.S vs STDEV.P

Excel has different functions depending on whether your data is a sample or the entire population.

  • STDEV.S(range)
    • Use when your data is a sample of a larger population.
* Uses the n−1n-1n−1 denominator (Bessel’s correction) to avoid underestimating variability.
  • STDEV.P(range)
    • Use when your data includes the whole population (you have every case).
* Uses the true population formula with nnn in the denominator.

Simple rule of thumb:

  • You surveyed part of your customers → STDEV.S.
  • You have all sales for last year, every transaction → STDEV.P.

3. Using the Insert Function dialog (no typing formulas)

If you prefer menus instead of typing, Excel lets you insert the function through the ribbon.

  1. Click the cell where you want the standard deviation.
  2. Go to the Formulas tab and click Insert Function (fx).
  1. In the category drop‑down, choose Statistical.
  1. Select STDEV.S (or STDEV.P if you truly have the full population) and click OK.
  1. In the Number1 box, type or select your data range (for example A1:A13).
  1. Click OK – the standard deviation will appear in the selected cell.

4. Basic formula pattern and examples

Here are some typical ways you’ll see the formulas used.

  • Data in A1:A10 (sample):
    =STDEV.S(A1:A10)

  • Data in B2:B31 (population):
    =STDEV.P(B2:B31)

  • Data stored as an Excel Table named Table1 with a column Scores:
    =STDEV.S(Table1[Scores])

You can also multiply the standard deviation, for example to get “two standard deviations”:
=2*STDEV.S(A1:A10).

5. Common mistakes to avoid

A few small errors can quietly change your result.

  • Including totals or averages in your range
    • Example: if you have an average in A11, don’t use A1:A11 as your range.
  • Mixing raw data and formulas in the same range you pass to STDEV.S or STDEV.P.
  • Using STDEV.P when you actually only have a sample, which underestimates the true variability.

A good habit is to keep raw data in one area and summary rows (like averages or totals) clearly separated so they aren’t accidentally included.

6. What Excel is doing behind the scenes (intuitively)

Conceptually, standard deviation measures how spread out your numbers are around the mean.

Behind STDEV.S or STDEV.P, Excel is effectively doing this:

  • Find the mean of your data.
  • Subtract the mean from each value and square the differences.
  • Average those squared differences (with n−1n-1n−1 for STDEV.S, nnn for STDEV.P).
  • Take the square root to get the standard deviation.

You don’t need to do these steps manually because the functions handle them for you, but understanding them helps you interpret the result.

7. Mini HTML table for quick reference

Here’s a compact HTML table you can drop into a page or notes:

html

<table>
  <thead>
    <tr>
      <th>Scenario</th>
      <th>Function</th>
      <th>Example Formula</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td>Sample of a larger population</td>
      <td>STDEV.S</td>
      <td>=STDEV.S(A1:A10)</td>
    </tr>
    <tr>
      <td>Entire population data</td>
      <td>STDEV.P</td>
      <td>=STDEV.P(B2:B31)</td>
    </tr>
    <tr>
      <td>Table column (sample)</td>
      <td>STDEV.S</td>
      <td>=STDEV.S(Table1[Scores])</td>
    </tr>
    <tr>
      <td>Two standard deviations (sample)</td>
      <td>STDEV.S * 2</td>
      <td>=2*STDEV.S(A1:A10)</td>
    </tr>
  </tbody>
</table>

All information above is drawn from up‑to‑date Excel tutorials and guides explaining how to use STDEV.S and STDEV.P with practical examples.

Information gathered from public forums or data available on the internet and portrayed here.