Adding Mean and Standard Deviation Lines on a Column Chart in Google Sheets

This post explains tips to add a standard deviation (SD) straight line to a column chart in Google Sheets. We will also include the mean line.

In my previous tutorial related to the function DSTDEV, I posted an image of the mean and SD straight lines on a chart.

The purpose was to show you which numbers (height of dog breeds) are within one standard deviation of the average (mean).

Since that post was not related to charts, I didn’t include the tips to create them.

So in this tutorial, you can learn how to add mean and standard deviation straight lines on a column chart in Google Sheets.

Adding Mean and Standard Deviation Lines to a Column Chart
screenshot # 1

Error Bars

We can use the Error Bars within the chart customization to display or add standard deviation bars on a column chart.

It is the easiest way. But it won’t be visually pleasing. Here are the steps, but concise, if you are interested.

  1. Select the data in A1:B12, i.e., the labels (dog breed names in column A) and numbers (heights in column B).
  2. Go to the menu Insert chart and select Column chart.
  3. Click Series under “Customisation” and check “Error Bars.”
  4. Select Standard deviation against “Type.” Leave the default value 1 in the field next to it.

That’s it!

Adding Standard Deviation (Error) Bars in Google Sheets
screenshot # 2

Adding Standard Deviation Lines on a Column Chart in Google Sheets

In screenshot # 1, the red horizontal line represents the average height of dogs in the array B2:B12, which is 294.

Note:- Later, I will use the below Average formula in cell C2 to calculate the mean, but in an array form.

=average(B2:B12)

For calculating SD and then adding the standard deviation (green) lines on the chart, you can use either of the below formulas/methods.

1. Population:

In the above example, there are 11 dog breeds.

Assume that is the complete data. In such a case, you can use the below STDEV.P formula to find the standard deviation, which returns 119.58.

=STDEV.P(B2:B12)

2. Population Sample:

If the data is a sample (a part of a large dataset), there is another function. Use the below STDEV.S formula in this case which would return 125.41.

=STDEV.S(B2:B12)

I will use this second formula because my data is a sample.

Please note that the functions STDEV and STDEV.S are the same. You can check my STDEV tutorial to learn the use.

Steps to Add Mean and Standard Deviation Straight Lines on a Chart

I have already given the necessary formulas to plot the said graph. Now let me elaborate on how to modify and include them. I mean, how to format the source data.

Data Formatting

We need three additional columns – one to show the average and the other two columns for standard deviation ±.

Enter the column names in C1:E1 as shown below (please refer to screenshot # 3).

We will enter array formulas in C2:E2. So C3:E12 must be kept blank.

To calculate the mean of the numbers in B2:B12 and fill it in C2:C12, use the below formula in C2.

=ArrayFormula(if(len(B2:B12),average(B2:B12),))

Use this formula in D2 to subtract the standard deviation from the mean and fill the range D2:D12.

=ArrayFormula(if(len(B2:B12),C2-STDEV.S($B$2:$B$12)))

The following formula goes in E2 to add standard deviation to the mean and fill the range E2:E12.

=ArrayFormula(if(len(B2:B12),C2+STDEV.S($B$2:$B$12)))
Average and STDEV Array Formulas to Draw Straight Lines
screenshot # 3

With this, our data formatting is complete!

Chart Insertion and Settings

We must choose the combination chart to add standard deviation straight lines on a column chart in Google Sheets.

We use columns to visualize dog breed height and lines for SD and Mean. Here we go!

Select the range A1:E12 and go to Insert menu and select Chart.

Please make sure that the below are the settings under the “Setup” tab in the chart editor.

Chart typeCombo
StackingNone
Data rangeA1:E12
X-axisDog Breed
SeriesHeight (mm)
Average
Standard Deviation
Standard Deviation
Enable tick marks against;Use row 1 as headers
Use column A as labels

Now under the “Customise” tab, under “Series,” select “Height (mm)” and set the format type to “Column.”

The other three series (Average, Standard Derivation [twice]) must be “Line.”

This way, we can add mean and standard deviation lines to a column chart in Google Sheets.

In all aspects, it will look better than the Error Bar one above.

That’s all. Thanks for the stay. Enjoy!

Similar Chart Resources

  1. Get a Target Line Across a Column Chart in Google Sheets.
  2. Average Line in Charts in Google Sheets.
  3. How to Create a Bell Curve Graph in Google Sheets.
Prashanth KV
Prashanth KV
Your Trusted Google Sheets and Excel Guide Prashanth KV brings a wealth of experience in Google Sheets and Excel, cultivated through years of work with multinational corporations in Mumbai and Dubai. As a recognized Google Product Expert in Docs Editors, Prashanth shares his expertise through insightful blogging since 2012. Explore his blog for practical tips and guidance on maximizing your spreadsheet skills.

Sort Data but Keep Blank Rows in Excel and Google Sheets

Using a dynamic array formula or the FILTER command, we can sort data and...

Lookup Values Under Categories in Excel and Google Sheets

We can use a combination of XLOOKUP and VLOOKUP in both Excel and Google...

Extract Items Under a Category from the Same Column in Excel

In Excel, you can use a combination of the XLOOKUP and DROP functions to...

How to Create a Searchable Table in Excel Using the FILTER Function

Finding specific records, or rows containing the required information, is straightforward in Excel using...

More like this

XMATCH Row by Row: Finding Values Across a Range in Google Sheets

Using the BYROW function with XMATCH in Google Sheets allows us to match values...

Limit Formula Expansion to a Specific Row in Google Sheets

In this tutorial, I’ll explain how to limit the expansion of an array formula...

3-D Referencing Structured Data Tables in Google Sheets

When you have several tables within a single sheet—not across multiple sheets in a...

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.