Database functions

DSTDEVP

Matches all 3 recorded answers

Recorded: 3 workbook cells. How we measure this · See the Rust code

Local names in 40 languages
LanguageName in Excel
ArabicDSTDEVP
BulgarianDSTDEVP
CzechDSMODCH
DanishDSTDAFVP
GermanDSTDEVP
GreekDSTDEVP
English (Australia)DSTDEVP
English (United Kingdom)DSTDEVP
English (United States)DSTDEVP
SpanishBDDESVESTP
EstonianDSTDEVP
FinnishTKESKIHAJONTAP
FrenchBDECARTYPEP
HebrewDSTDEVP
CroatianDSTDEVP
HungarianAB.SZÓRÁS2
IndonesianDSTDEVP
ItalianDSTDEVP
JapaneseDSTDEVP
KoreanDSTDEVP
LithuanianDSTDEVP
LatvianDSTDEVP
NorwegianDSTDEVP
DutchDBSTDEVP
PolishBD.ODCH.STANDARD.POPUL
Portuguese (Brazil)DSTDEVP
Portuguese (Portugal)BDDESVPADP
RomanianDSTDEVP
RussianДСТАНДОТКЛП
SlovakDSTDEVP
SlovenianDSTDEVP
Serbian (Latin)DSTDEVP
SwedishDSTDAVP
ThaiDSTDEVP
TurkishVSEÇSTDSAPMAS işlevi
UkrainianDSTDEVP
VietnameseDSTDEVP
Chinese (Simplified)DSTDEVP
Chinese (Hong Kong)DSTDEVP
Chinese (Traditional)DSTDEVP

Names from Microsoft's support site.

What it does

DSTDEVP(database, field, criteria)

DSTDEVP(database, field, criteria) selects the records of database that satisfy criteria, reads the column named by field, and returns the population standard deviation of the numeric values found there.

With V = [ v₁ … vₙ ] the Numbers collected from the field column of the matching records, in record order, and n = |V|:

x̄ = (Σ vᵢ) / n
σ = √( Σ (vᵢ − x̄)² / n )

Operationally it is DVARP followed by one square root; the reference implementation computes it exactly that way. The divisor is n, not n − 1, so a single numeric value is enough — and yields exactly 0, the standard deviation of a one-element population.

Non-numeric cells in the field column — text, logicals, blanks — are skipped, so n counts numbers, not records.

The selection stage — header matching, AND across a criteria row, OR down the rows, blank criteria cells, and criteria-expression parsing — is identical for all twelve database functions and is explained once in the criteria-range mechanism.

Two accounts carry over from the sibling pages and are not repeated here: which variance formula is used, on the DVAR page, and the extra rounding introduced by taking a square root of an already-rounded variance, on the DSTDEV page.

Arguments

Three arguments, all required at the call site; the reference implementation declares an arity of exactly 3.

  • database — the header-plus-records range or array.
  • field — the column selector, as header text or as a 1-based column index within the database range. Required.
  • criteria — the header-plus-conditions range or array.

Try it

Input cells (optional)

Example: {"B2": 3, "B3": 4}. A1 holds the formula. Other cells need values before a formula can read them.

Enter a formula, then calculate.

Runs locally in your browser with OneCalc. Its answer may differ from Excel. Use English function names and commas between arguments.

Quirks

Result and edge cases

Returns a Number, non-negative.

  • No numeric value selected: #DIV/0!, from the variance stage.
  • Exactly one numeric value selected: 0. DSTDEV returns #DIV/0! on the same input; this is the cleanest observable difference between the pair.
  • All selected values equal: 0, exactly.
  • Text that looks numeric in the field column is skipped, per the range-scan side of the asymmetry in coercion and lifting.
  • Logicals in the field column are skipped.
  • Arrays: inline array literals resolve to grids and are accepted; DSTDEVP is not a lift kernel.
  • No negative-argument path, for the same reason as DSTDEV: the two-pass variance cannot be negative, so the square root has no domain failure.

Errors

ErrorCondition
#DIV/0!No numeric value was collected from the field column of the matching records
#VALUE!database or criteria is not a grid or is empty; a database header cell is blank; a criteria header names no database field; field matches no header, or is a non-integer or out-of-range column index
propagatedAn error value in a header cell, a criteria cell, or a scanned field cell surfaces as that error

How to implement

Notes for implementers

  1. Guard on n = 0 only, and share nothing with the sample member except the accumulation — switching the divisor without switching the minimum count is the natural bug in this quartet.
  2. Compose, do not reformulate: variance first, then one square root.
  3. The n = 1 answer should be exactly +0.
  4. Skip, do not coerce. Admit only cells whose value kind is Number.
  5. Numeric criteria comparison is not exact double comparison — see the note in the shared mechanism.

Rust code

Show the CalcFunc source of this function

Quoted from the public repository DnaCalc/DnaCalc, crates calc-func and calc-fml, at commit 9e1884369a67. Comments are the source's own. A kernel shared with other functions appears once, on its module page.

DSTDEVP · 1 lines · calc-func/src/catalogue/database.rs on GitHub
9 dstdevp "DSTDEVP" (3, 3) [R "database", V "field", R "criteria"] |s, a, sv| { database(s, a, sv, Kind::StdevP) }

Kernels shared with other functions

Argument and result plumbing

No implementation has been published with a Handbook test suite for this function.

Version differences

No comparison between specific Excel builds is recorded here yet. This does not establish that all builds behave alike.

Alternatives

Relationships

  • DSTDEV is the sample form: divisor n − 1, minimum two values.
  • DVARP is the square of this function.
  • Nearest modern equivalent: STDEV.P over a filtered array. Excel's compatibility rename pass produced STDEVP / STDEV.P; the database family was left out of it, so DSTDEVP is not a deprecated name and has no .P-suffixed replacement.
  • Confused with: DSTDEV (the divisor and the minimum count) and STDEVPA, which counts logicals and text as values.

Named variants

No named variants are recorded yet.

Suggest a correction or contribute an implementation · For agents