STDEV.S in Google Sheets: Step-by-Step Guide
In this article
STDEV.S calculates the sample standard deviation of a set of numbers in Google Sheets. Use it when your data is a sample drawn from a larger population, not the entire population. The syntax is =STDEV.S(number1, [number2], ...), where you can pass individual numbers, cell references, ranges, or a mix. For example, =STDEV.S(A2:A10) returns the sample standard deviation of the values in A2 through A10. If you have the full population, use STDEV.P instead. The result is a single number that tells you how spread out your data is around the mean — a higher value means more variability.
What You'll Need
- A Google account and access to Google Sheets (sheets.google.com).
- A spreadsheet with at least two numeric values in a column or row, or you can type numbers directly into the formula.
- Basic familiarity with entering formulas (starting with =).
Step-by-Step
- Open your spreadsheet. Go to Google Sheets and open the file containing your data, or create a new blank spreadsheet.
- Identify your data range. Decide which cells hold the sample values. For example, if your numbers are in column A from row 2 to row 10, your range is A2:A10. Make sure the cells contain numbers only — text, blanks, or errors will be ignored by STDEV.S, which can change the result.
- Select the cell for the result. Click an empty cell where you want the standard deviation to appear, such as B1 or D2.
- Type the formula. Enter
=STDEV.S(and then either type your range (e.g.,A2:A10) or click and drag to select the cells. Close the parenthesis and press Enter. The complete formula looks like=STDEV.S(A2:A10). - Check the output. The cell now shows the sample standard deviation. If you see an error like #DIV/0! or #NUM!, see Troubleshooting below.
- Copy the formula if needed. Drag the fill handle (small square at the bottom-right of the cell) to apply the same formula to other columns or rows, adjusting references as required.
- Format the result (optional). Use the toolbar to increase or decrease decimal places so the number is easy to read. The underlying value does not change.
Common Mistakes
- Using STDEV.S on an entire population. If your data includes every member of the group you care about, use STDEV.P. STDEV.S divides by n−1 (sample size minus one), which gives a slightly larger result than STDEV.P.
- Including text or blank cells in the range. STDEV.S ignores text and empty cells, but if your range contains error values (like #N/A), the formula returns an error. Clean the data first.
- Forgetting the equals sign. A formula must start with =. Without it, Sheets treats your entry as text.
- Mixing ranges and individual numbers incorrectly. You can write
=STDEV.S(A2:A10, 5, 7), but be aware that the extra numbers are included in the calculation. Only add them if they belong to your sample. - Assuming STDEV.S works on non-numeric data. It requires numbers. Dates and times are stored as numbers in Sheets, so they will be included — which may not be what you want.
Tips
- Use named ranges to make formulas easier to read: select your data, go to Data > Named ranges, and give it a name like SalesData. Then write
=STDEV.S(SalesData). - Combine STDEV.S with AVERAGE to describe your data: the mean plus or minus one standard deviation covers roughly 68% of a normal distribution.
- If you need to ignore zeros, filter them out first or use a helper column; STDEV.S includes zeros as valid numbers.
- Press Ctrl+` (backtick) to toggle showing formulas instead of results, which helps you audit your sheet.
- Remember that STDEV.S returns a sample standard deviation; for a population, switch to STDEV.P.
Troubleshooting
- #DIV/0! error: This means fewer than two numeric values were found in your range. STDEV.S needs at least two numbers to calculate a sample standard deviation. Check that your range actually contains numbers and that no cells are formatted as text.
- #NUM! error: Usually caused by an invalid argument, such as a range that contains only text or a reference to a cell with an error. Verify each argument is a number or a range of numbers.
- #NAME? error: The function name is misspelled. Ensure you typed STDEV.S exactly, including the period. In some locales the function may be written differently; Google Sheets generally accepts the English name.
- Result looks wrong: Double-check that your range does not include header rows, totals, or other non-sample values. Also confirm you are using STDEV.S (sample) versus STDEV.P (population) as intended.
- Formula not updating: If calculation is set to manual (uncommon in Sheets), go to File > Settings > Calculation and set to automatic. Otherwise, try recalculating by editing and re-entering the formula.
Frequently Asked Questions
What is the difference between STDEV.S and STDEV.P?
STDEV.S estimates the standard deviation of a population based on a sample, using n−1 in the denominator. STDEV.P calculates the standard deviation of an entire population, using n. Use STDEV.S when your data is a sample; use STDEV.P when you have all the data.
Can STDEV.S handle text or blank cells?
Yes, it ignores text, logical values, and empty cells within a range. However, if you type logical values or text directly as arguments (e.g., TRUE or "abc"), they may cause errors or be treated as numbers in some cases. Stick to numeric ranges for predictable results.
Does STDEV.S work with filtered or hidden rows?
STDEV.S includes all values in the range, including hidden rows. If you need to calculate standard deviation on visible cells only, use SUBTOTAL with function number 107 or 7, but note that SUBTOTAL does not directly support STDEV.S; you may need a helper column or array formula.
How many numbers do I need for STDEV.S?
At least two numeric values. With only one number, the sample standard deviation is undefined and Sheets returns #DIV/0!.
Can I use STDEV.S across multiple sheets?
Yes, reference ranges on other sheets like =STDEV.S(Sheet2!A1:A10). You can also combine ranges from different sheets using comma-separated arguments, e.g., =STDEV.S(Sheet1!A1:A10, Sheet2!B1:B10).
Is STDEV.S available in Excel too?
Yes, Excel has the same function with identical syntax. Google Sheets and Excel are compatible for this function, so formulas usually transfer without changes.