What is the DPRODUCT function?
=DPRODUCT(database, field, criteria)DPRODUCT picks only the records in a list (database) that meet a criteria table and multiplies the numbers in the field (column) you choose. Its conditions are written as a separate table on the sheet.
Change the criteria range and the field to watch each record checked and multiplied.
DPRODUCT is the least used of the database functions, but it fits when the values to combine are multipliers, such as growth factors or yield rates for the records that meet a condition. Like the other database functions, the criteria live in a table on the sheet, so editing the table switches which records are multiplied.
Arguments
- database
- The whole list. The first row must hold the headers.
- field
- The column to calculate: a column number (the first column is 1), a header name such as "Sales", or a cell holding the header (D1).
- criteria
- The criteria table. Its first row uses the same headers as the database, with the conditions below.
DPRODUCT examples
Example 1. Basic use
=DPRODUCT(A1:D9, 3, F1:F2)Multiplies the Seoul quantities 30, 8 and 40: 9600.
Example 2. AND condition
=DPRODUCT(A1:D9, 3, F1:G2)Seoul records with sales of 40000 or more have quantities 30 and 40: 1200.
Example 3. Results for each criteria range
=DPRODUCT(A1:D9, "Qty", criteria)The same formula with only the criteria range changed.
Criteria range Quantities multiplied Result F1:F2 30, 8, 40 9,600 F1:G2 30, 40 1,200 F5:F6 40 40
Common mistakes
Leaving the header out of the criteria range
The first row of the criteria range must be a header. Without it, the first condition is read as the header.
Mixing up AND and OR
Conditions on the same row must all be met (AND); conditions on different rows only need one to be met (OR).
A result of 0 is ambiguous
No matching record also returns 0. Check the count with DCOUNT so you can tell "nothing matched" from a real 0.
FAQ
- What if no record matches?
- The result is 0.
- Text fields?
- Values that are not numbers are skipped, not multiplied.