Calc Guide
Database functions
This section deals with functions used with data organized as one row
of data for one record. The Database category should not be confused
with the Base database component in OpenOffice.org. A Calc database
is simple a range of cells that comprises a block of related data where
each row contains a separate record. There is no connection between a
database in OpenOffice.org and the Database category in OOo Calc.
The database functions use the following common arguments:
• Database is a range of cells which define the database.
• Database_field specifies the column where the function operates
on after the search criteria of the first parameter is applied and
the data rows are selected. It is not related to the search criteria
itself. The number 0 specifies the whole data range. To reference
a column by using the column header name, place quotation
marks around the header name.
• Search_criteria is a cell range containing the search criteria..
Empty cells in the search criteria range will be ignored.
Note
All of the search-criteria arguments for the database functions
support regular expressions. For example, “all.*” can be entered
to find the first location of “all” followed by any characters. To
search for text that is also a regular expression, precede every
character with a \ character. You can switch the automatic
evaluation of regular expressions on and off in Tools > Options
> OpenOffice.org Calc > Calculate.
Table 41: Database average
Syntax Description
DAVERAGE(database;
database_field;
search_criteria)
Returns the average of the values of all cells
(fields) in all rows (database records) that match
the specified search_criteria. The search
supports regular expressions.
DCOUNT(database;
database_field;
search_criteria)
Counts the number of rows (records) in a database
that match the specified search_criteria and
contain numerical values. The search supports
regular expressions. For the database_field
parameter, enter a cell address to specify the
column, or enter the number 0 for the entire
database. The parameter cannot be empty.
466 OpenOffice.org 3.x Calc Guide