Database functions
DPRODUCT
Matches all 3 recorded answers
Recorded: 3 workbook cells. How we measure this · See the Rust code
Local names in 40 languages
| Language | Name in Excel |
|---|---|
| Arabic | DPRODUCT |
| Bulgarian | DPRODUCT |
| Czech | DSOUČIN |
| Danish | DPRODUKT |
| German | DPRODUCT |
| Greek | DPRODUCT |
| English (Australia) | DPRODUCT |
| English (United Kingdom) | DPRODUCT |
| English (United States) | DPRODUCT |
| Spanish | BDPRODUCTO |
| Estonian | DPRODUCT |
| Finnish | TTULO |
| French | BDPRODUIT |
| Hebrew | DPRODUCT |
| Croatian | DPRODUCT |
| Hungarian | AB.SZORZAT |
| Indonesian | DPRODUCT |
| Italian | DPRODUCT |
| Japanese | DPRODUCT |
| Korean | DPRODUCT |
| Lithuanian | DPRODUCT |
| Latvian | DPRODUCT |
| Norwegian | DPRODUKT |
| Dutch | DBPRODUCT |
| Polish | BD.ILOCZYN |
| Portuguese (Brazil) | DPRODUCT |
| Portuguese (Portugal) | BDMULTIPL |
| Romanian | DPRODUCT |
| Russian | БДПРОИЗВЕД |
| Slovak | DPRODUCT |
| Slovenian | DPRODUCT |
| Serbian (Latin) | DPRODUCT |
| Swedish | DPRODUKT |
| Thai | DPRODUCT |
| Turkish | VSEÇÇARP işlevi |
| Ukrainian | DPRODUCT |
| Vietnamese | DPRODUCT |
| Chinese (Simplified) | DPRODUCT |
| Chinese (Hong Kong) | DPRODUCT |
| Chinese (Traditional) | DPRODUCT |
Names from Microsoft's support site.
What it does
DPRODUCT(database, field, criteria)
DPRODUCT(database, field, criteria) selects the records of database that satisfy criteria,
reads the column named by field, and returns the product of the numeric values found there.
With R the set of selected record rows, c the resolved field column, and
V = [ v : v = value of cell (r, c) for r in R, in record order, where v is a Number ]
Non-numeric cells in the field column contribute nothing: text (including text that reads as a number), logicals, and blanks are skipped rather than coerced. Note the asymmetry with DSUM: skipping a cell is the same as adding zero for a sum, but it is not the same as multiplying by one — it is what makes the product well-defined at all, since coercing a blank to zero would annihilate every result containing one.
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.
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
Quirks
Result and edge cases
Returns a Number.
- No numeric value selected:
0. See above; this is the convention, not the empty product. - A single matching value: that value, unchanged.
- A zero anywhere in the value list:
0, for the ordinary reason. - Overflow. Products grow fast. The family's declared real-result policy is
non_finite=allowwith no argument-domain guard, meaning the reference implementation does not itself convert an overflowing product to#NUM!— see result publication for what that axis means. What Excel publishes for an overflowingDPRODUCTis unchecked, and it is the most consequential open question on this page. - 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, so
TRUEnever contributes a factor of 1 andFALSEnever annihilates the product. - Arrays: inline array literals resolve to grids and are accepted;
DPRODUCTis not a lift kernel.
Errors
| Error | Condition |
|---|---|
#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 |
| propagated | An error value in a header cell, a criteria cell, or a scanned field cell surfaces as that error |
How to implement
Notes for implementers
- Reduction order is observable. The family declares a sequential left fold. Floating-point multiplication is not associative, so a reassociated or pairwise product will differ in the last bits, and on values near the representable range the order alone can decide whether an intermediate overflows.
- The empty-selection zero must be special-cased. A fold with initial value
1gives1for an empty list, which is mathematically right and behaviourally wrong here. Branch on emptiness explicitly. - Skip, do not coerce. Admit only cells whose value kind is Number. Coercing blanks to zero
would turn most real columns into
0. - 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.
DPRODUCT · 1 lines · calc-func/src/catalogue/database.rs on GitHub7 dproduct "DPRODUCT" (3, 3) [R "database", V "field", R "criteria"] |s, a, sv| { database(s, a, sv, Kind::Product) }
Kernels shared with other functions
readercatalogue/aggregateread_referencecatalogue/aggregatenumberscatalogue/comparisonin_bandcatalogue/comparisonRounded::upcatalogue/comparisonRoundings::ofcatalogue/comparisonRoundings::disjointcatalogue/comparisontextscatalogue/comparisoncomparecatalogue/comparison/collationweighedcatalogue/comparison/collationmeasured_iteration_extensioncatalogue/comparison/collationtablecatalogue/comparison/sort_keydecode64catalogue/comparison/sort_keyReader::bytecatalogue/comparison/sort_keyReader::varintcatalogue/comparison/sort_keyReader::donecatalogue/comparison/sort_keyin_rangescatalogue/comparison/sort_keybuildcatalogue/comparison/sort_keyhan_basecatalogue/comparison/sort_keyderivecatalogue/comparison/sort_keyshared_jamo_tailscatalogue/comparison/sort_keyordinary_jamo_prefixcatalogue/comparison/sort_keyindependent_jamo_suffixcatalogue/comparison/sort_keyjamo_leading_primarycatalogue/comparison/sort_keyleading_ordercatalogue/comparison/sort_keyBefore::separate_specialcatalogue/comparison/sort_keyGathered::kanacatalogue/comparison/sort_keyGathered::unitcatalogue/comparison/sort_keypartscatalogue/comparison/sort_keydiacritic_ordercatalogue/comparison/sort_keydiacriticscatalogue/comparison/sort_keyrangecatalogue/conditionalrowcatalogue/conditionaloffsetcatalogue/conditionalread_rangecatalogue/conditionalverdictscatalogue/conditionalusedcatalogue/conditionalMatch::ofcatalogue/conditionalMatch::negatedcatalogue/conditionalOp::holdscatalogue/conditionalOp::is_equalitycatalogue/conditionalspellscatalogue/conditionalcriterioncatalogue/conditionaldatabase_criterioncatalogue/conditionalrankcatalogue/conditionalcriterion_textcatalogue/conditionaldecidedcatalogue/conditionalCriterion::verdictcatalogue/conditionalequalitycatalogue/conditionalis_surrogatecatalogue/conditionalwildcardcatalogue/conditionallabelcatalogue/databasesame_labelcatalogue/databasefieldcatalogue/databasematchingcatalogue/databasecriterion_verdictcatalogue/databasedatabasecatalogue/databasepublishedcatalogue/databaselow32decimalNatural::from_u64decimalNatural::pow10decimalNatural::normalizedecimalNatural::is_zerodecimalNatural::mul_add_smalldecimalNatural::times_pow10decimalNatural::times_pow5decimalNatural::times_pow2decimalExactDecimal::binarydecimalexcel_sqrt_stagedported/excel_numerictextported/text_kernelstext_from_strported/text_kernelsfold_unitported/text_kernelspush_singleton_or_originalported/text_kernelspush_lowerported/text_kernelslowerported/text_kernelsvariance_from_valuesported/variance_commonstdev_from_valuesported/variance_common
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
- DSUM is the additive counterpart, with the same skip policy and the same empty-selection zero — which is the correct additive identity there and the wrong multiplicative one here.
- Nearest equivalent:
PRODUCTcombined withIF, entered as an array formula, orEXP(SUMIFS(LN(...)))for strictly positive data. Excel has noPRODUCTIFS, which makesDPRODUCTthe only criteria-driven product in the worksheet surface — a genuinely unique role in the function catalogue. - Confused with:
PRODUCT(no selection stage) andSUMPRODUCT(which sums products across columns rather than multiplying down one).
Named variants
No named variants are recorded yet.
Suggest a correction or contribute an implementation · For agents