Documentation/How Tos/Calc: DPRODUCT function

From OpenOffice.org Wiki

Jump to: navigation, search


DPRODUCT

Returns the product of cells in a column of a Calc 'database' table, in rows which meet specified criteria.


Syntax:

DPRODUCT(database_table; field; criteria_table)

where

database_table is a range defining the data to be processed.
field is the column to sum. It may be a column number (1 is the first column of the database table, 2 is the second ...) or a column header (enclosed in quotation marks ””) or a cell referring to a column header.
criteria_table is a range containing criteria, which are used to select which rows of the database_table to sum.


The Database functions overview describes the use of these parameters in detail.


DPRODUCT multiplies together the contents of all cells found in the field column.


Example:

In this spreadsheet:

 ABCDE
1Box sizeDimensioncm Box size
2Awidth23 C
3Aheight19  
4Adepth35  
5Bwidth35  
6Bheight35  
7Bdepth19  
8Cwidth23  
9Cheight35  
10Cdepth21  
11Dwidth19  
12Dheight17  
13Ddepth12  


DPRODUCT(A1:C13; "cm"; E1:E2)

returns the volume of Box C - that is, the product of all cells in the "cm" column whose Box size is C (width * height * depth = 23 * 35 * 21 = 16905).

Issues:

The OOo2.3 Help implies that 0 as a field will include the entire database table. This seems to be wrong - only a single column can be processed.


See Also


Personal tools
Create a book