How to Use the DSTDEVP Function in Google Sheets

This post explains how to use the DSTDEVP function in Google Sheets to calculate the standard deviation of an entire population.

When calculating standard deviation in Google Sheets, functions are categorized into two types: Database and Statistical.

Database functions allow you to apply calculations on selected entries in a dataset, whereas Statistical functions do not. For statistical calculations, you may need to use functions like QUERY or FILTER to apply criteria, which is where database functions excel.

The DSTDEVP function in Google Sheets belongs to the database category. The key point to remember is that these functions require a well-formatted dataset.

A well-formatted dataset is a multi-column array or range containing field labels (column names) in the topmost row. Below is an example of such a dataset.

Example of Structured Data for Database Functions

Introduction

Before diving into the function syntax and formula examples, let’s grasp the basics of standard deviation calculations. Standard deviation is a crucial statistical measure that helps us understand the variability in a dataset. By calculating the standard deviation of a dataset, we can assess how spread out the values are around the mean (average).

Consider the highlighted records in the table above. Here’s how to calculate the standard deviation of the values in the “Price” column without using the DSTDEVP function:

  1. Calculate the Mean:
    =(60+90+80+75)/4 // returns 76.25
  2. Subtract the Mean and Square the Result:
    =(60-76.25)^2+(90-76.25)^2+(80-76.25)^2+(75-76.25)^2 // returns 468.75
  3. Divide by the Number of Data Points:
    =((60-76.25)^2+(90-76.25)^2+(80-76.25)^2+(75-76.25)^2)/4 // returns 117.1875
  4. Take the Square Root: 10.825 [=SQRT(117.1875)].

Understanding standard deviation is beneficial for various reasons. It helps in identifying trends and patterns within data, allowing for better decision-making.

Syntax of the DSTDEVP Function in Google Sheets

Syntax:

DSTDEVP(database, field, criteria)

Arguments:

  • database: The structured data or well-formatted dataset, as explained earlier.
  • field: The column index number that contains the value to calculate. You can either use the corresponding field label (in double quotation marks) or the column index number (the relative position of the calculation column in the database).
  • criteria: Specifies which records to include in the calculation. This must be entered as an array and must contain at least one field label and one cell below it.

Formula Examples

Like other database functions, you can provide criteria as a range reference or hard-code them within the formula.

Examples of the DSTDEVP Function in Google Sheets

Example 1: One Criterion

=DSTDEVP(C2:E18, "Price", G3:G4)

Where:

  • database: C2:E18
  • field: "Price"
  • criteria: G3:G4

Example 2: Two Criteria

=DSTDEVP(C2:E18, "Price", G7:H8)

In this example, the database and field remain the same since we are using the same table. However, the criteria range differs, as it is set to G7:H8.

Hard-Coding Criteria in the DSTDEVP Function

Google Sheets database functions are flexible regarding the use of conditions. In the examples above, the criteria were specified as an external array. Here’s how to hard-code them within the formula:

Example 1: Hard-Coded Criterion

=DSTDEVP(C2:E18, "Price", {"Item"; "Apple"})

Example 2: Hard-Coded with Two Criteria

=DSTDEVP(C2:E18, "Price", {"City", "Item"; "B", "Apple"})

If you want to omit filtering and not include any criteria, remember that all arguments are mandatory. To achieve this, you can use two empty cells in the criteria section, such as {IF(,,); IF(,,)}. This allows you to satisfy the function’s requirements without applying any specific conditions.

Resources

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.

How to Extract Numbers from Text in Excel with Regex

You can use the REGEXEXTRACT or REGEXREPLACE functions to easily extract numbers from text...

Using OFFSET and MATCH Together in Google Sheets: Advanced Tips

One powerful and flexible way to look up values is by combining the OFFSET...

How to Use OFFSET and XMATCH Functions Together in Excel

We often use the OFFSET and XMATCH functions together to match a value in...

How to Calculate Maximum Drawdown in Excel and Google Sheets

You can use the following dynamic array formula to calculate maximum drawdown (MDD) in...

More like this

Using OFFSET and MATCH Together in Google Sheets: Advanced Tips

One powerful and flexible way to look up values is by combining the OFFSET...

Running Count with Structured References in Google Sheets

Running a count with structured references is achievable in Google Sheets tables using the...

Running Total with Structured Table References in Google Sheets

You can use two types of formulas to create a running total with structured...

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.