Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

OpenOffice Calc User Guide
Previous Page Home Next Page

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 17: 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.

DCOUNTA(database; database_field; search_criteria)

Counts the number of rows (records) in a database that match the specified search_criteria and contain numeric or alphanumeric values. The search supports regular expressions.

DGET(database; database_field; search_criteria)

Returns the contents of the referenced cell in a database which matches the specified search_criteria. In case of an error, the function returns either #VALUE! for no row found, or Err502 for more than one cell found.

DMAX(database; database_field; search_criteria)

Returns the maximum content of a cell (field) in a database (all records) that matches the specified search_criteria. The search supports regular expressions.

DMIN(database; database_field; search_criteria)

Returns the minimum content of a cell (field) in a database that matches the specified search_criteria. The search supports regular expressions.

DPRODUCT(database; database_field; search_criteria)

Multiplies all cells of a data range where the cell contents match the search_criteria. The search supports regular expressions.

DSTDEV(database; database_field; search_criteria)

Calculates the standard deviation of a population based on a sample, using the numbers in a database column that match the search_criteria. The records are treated as a sample of data. Note that a representative result of a large population can not be obtained from a sample of fewer than one thousand.

DSTDEVP(database; database_field; search_criteria)

Calculates the standard deviation of a population based on all cells of a data range which match the search_criteria. The records from the example are treated as the whole population.

DSUM(database; database_field; search_criteria)

Returns the total of all cells in a database field in all rows (records) that match the specified search_criteria. The search supports regular expressions.

DVAR(database; database_field; search_criteria)

Returns the variance of all cells of a database field in all records that match the specified search_criteria. The records from the example are treated as a sample of data. A representative result of a large population cannot be obtained from a sample population of fewer than one thousand.

DVARP(database; database_field; search_criteria)

Calculates the variance of all cell values in a database field in all records that match the specified search_criteria. The records are from the example are treated as an entire population.

OpenOffice Calc User Guide
Previous Page Home Next Page

 
 
  Published under the terms of the Open Publication License Design by Interspire