Sisukord
Register 🔎︎

# Andmebaasifunktsioonid

This section deals with functions used with data organized as one row of data for one record.

Andmebaasi kategooriat võidakse ajada segi selle andmebaasiga, mis on integreeritud LibreOffice'iga. Tegelikult ei ole LibreOffice'i andmebaasi ja LibreOffice Calci andmebaasi kategooria vahel mingit seost.

### Näidisandmed:

Järgnevaid andmeid kasutatakse osade funktsioonide kirjeldamisel näidetena:

Vahemik A1:E10 sisaldab loendit lastest, kes on kutsutud Joe sünnipäevale. Iga kirje sisaldab järgnevat teavet: veerg A näitab nime, B klassi, siis tulevad vanus aastates, koolitee pikkus meetrites ja lapse kaal kilogrammides.

| A | B | C | D | E
1 | Name | Klass | Vanus | Koolitee pikkus | Kaal
2 | Andy | 3 | 9 | 150 | 40
3 | Betty | 4 | 10 | 1000 | 42
4 | Charles | 3 | 10 | 300 | 51
5 | Daniel | 5 | 11 | 1200 | 48
6 | Eva | 2 | 8 | 650 | 33
7 | Frank | 2 | 7 | 300 | 42
8 | Greta | 1 | 7 | 200 | 36
9 | Harry | 3 | 9 | 1200 | 44
10 | Irene | 2 | 8 | 1000 | 42
11 |  |  |  |  |
12 |  |  |  |  |
13 | Name | Klass | Vanus | Koolitee pikkus | Kaal
14 |  |  |  | >600 |
15 |  |  |  |  |
16 | DCOUNT | 5 |  |  |

The formula in cell B16 is =DCOUNT(A1:E10;D1;A13:E14)

### Andmebaasifunktsiooni argumendid:

Järgnevas loetelus on kõikide andmebaasifunktsioonide argumentide definitsioonid:

Andmebaas on lahtrite vahemik, mis määrab andmebaasi.

DatabaseField 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. For the DatabaseField parameter you can enter a reference to a header cell or a number to specify the column within the Database area, starting with 1. To reference a column by means of the literal column header name, place quotation marks around the header name.

SearchCriteria is the cell range containing search criteria. If you write several criteria in one row they are connected by AND. If you write the criteria in different rows they are connected by OR. Empty cells in the search criteria range will be ignored.

Choose LibreOffice - PreferencesTools - Options - LibreOffice Calc - Calculate to define how LibreOffice Calc acts when searching for identical entries.

See also the Wiki page about Conditional Counting and Summation.

## DAVERAGE

DAVERAGE tagastab kõikide ridade (andmebaasi kirjete) hulgast määratud otsingukriteeriumitele vastavate lahtrite (väljade) väärtuste keskmise.

The search supports wildcards or regular expressions. With regular expressions enabled, you can enter "all.*", for example to find the first location of "all" followed by any characters. If you want to search for a text that is also a regular expression, you must either precede every character with a "\" character, or enclose the text into \Q...\E. You can switch the automatic evaluation of wildcards or regular expression on and off in LibreOffice - PreferencesTools - Options - LibreOffice Calc - Calculate.

When using functions where one or more arguments are search criteria strings that represents a regular expression, the first attempt is to convert the string criteria to numbers. For example, ".0" will convert to 0.0 and so on. If successful, the match will not be a regular expression match but a numeric match. However, when switching to a locale where the decimal separator is not the dot makes the regular expression conversion work. To force the evaluation of the regular expression instead of a numeric expression, use some expression that can not be misread as numeric, such as ".[0]" or ".\0" or "(?i).0".

#### Süntaks

DAVERAGE(andmebaas; andmebaasi väli; otsingukriteeriumid)

For the DatabaseField parameter you can enter a reference to a header cell or a number to specify the column within the Database area, starting with 1. To reference a column by means of the literal column header name, place quotation marks around the header name.

#### Näide

Et leida, kui suur on ülaltoodud näite (keri ülespoole, palun) kõikide samaealiste laste keskmine kaal, sisestame lahtrisse B16 järgmise valemi:

=DAVERAGE(A1:E10;"Kaal";A13:E14)

Reale 14, Vanuse alla sisestame üksteise järel väärtused 7, 8, 9, jne. Vastuse väljale ilmub sama vanusega laste keskmine kaal.

## DCOUNT

DCOUNT counts the number of rows (records) in a database that match the specified search criteria and contain numerical values in the DatabaseField column.

The search supports wildcards or regular expressions. With regular expressions enabled, you can enter "all.*", for example to find the first location of "all" followed by any characters. If you want to search for a text that is also a regular expression, you must either precede every character with a "\" character, or enclose the text into \Q...\E. You can switch the automatic evaluation of wildcards or regular expression on and off in LibreOffice - PreferencesTools - Options - LibreOffice Calc - Calculate.

When using functions where one or more arguments are search criteria strings that represents a regular expression, the first attempt is to convert the string criteria to numbers. For example, ".0" will convert to 0.0 and so on. If successful, the match will not be a regular expression match but a numeric match. However, when switching to a locale where the decimal separator is not the dot makes the regular expression conversion work. To force the evaluation of the regular expression instead of a numeric expression, use some expression that can not be misread as numeric, such as ".[0]" or ".\0" or "(?i).0".

#### Süntaks

DCOUNT(Database; [DatabaseField]; SearchCriteria)

If the DatabaseField argument is omitted, DCOUNT returns the count of all records that satisfy Criteria. For the DatabaseField parameter you can enter a reference to a header cell or a number to specify the column within the Database area, starting with 1. To reference a column by means of the literal column header name, place quotation marks around the header name.

#### Näide

In the example above (scroll up, please), we want to know how many children have to travel more than 600 meters to school. The result is to be stored in cell B16. Set the cursor in cell B16. Enter the formula =DCOUNT(A1:E10;D1;A13:E14) in B16. The Function Wizard helps you to input ranges.

Database is the range of data to be evaluated, including its headers: in this case A1:E10. DatabaseField specifies the column for the search criteria: in this case, the column with the numerical distance values. SearchCriteria is the range where you can enter the search parameters: in this case, A13:E14.

Uurime näiteks, mitu last teises klassis on üle 7 aasta vanad, selleks kustutame kirje >600 lahtris D14 ja sisestame 2 lahtrisse B14, Klassi alla ning sisestame >7 lahtrisse C14 temast paremal. Vastus on 2. Kaks last on teises klassis ja üle 7 aasta vanad. Kuna mõlemad tingimused on ühes reas, on nad ühendatud loogilise JA-ga.

## DCOUNTA

DCOUNTA loendab andmebaasi read (kirjed), mis vastavad määratud otsingukriteeriumitele ja sisaldavad arvulisi või tähti ja numbreid sisaldavaid väärtusi.

The search supports wildcards or regular expressions. With regular expressions enabled, you can enter "all.*", for example to find the first location of "all" followed by any characters. If you want to search for a text that is also a regular expression, you must either precede every character with a "\" character, or enclose the text into \Q...\E. You can switch the automatic evaluation of wildcards or regular expression on and off in LibreOffice - PreferencesTools - Options - LibreOffice Calc - Calculate.

When using functions where one or more arguments are search criteria strings that represents a regular expression, the first attempt is to convert the string criteria to numbers. For example, ".0" will convert to 0.0 and so on. If successful, the match will not be a regular expression match but a numeric match. However, when switching to a locale where the decimal separator is not the dot makes the regular expression conversion work. To force the evaluation of the regular expression instead of a numeric expression, use some expression that can not be misread as numeric, such as ".[0]" or ".\0" or "(?i).0".

#### Süntaks

DCOUNTA(Database; [DatabaseField]; SearchCriteria)

If the DatabaseField argument is omitted, DCOUNTA returns the count of all records that satisfy Criteria. For the DatabaseField parameter you can enter a reference to a header cell or a number to specify the column within the Database area, starting with 1. To reference a column by means of the literal column header name, place quotation marks around the header name.

#### Näide

In the example above (scroll up, please), you can search for the number of children whose name starts with an E or a subsequent letter. Edit the formula in B16 to read =DCOUNTA(A1:E10;"Name";A13:E14). Delete the old search criteria and enter >=E under Name in field A14. The result is 5. If you now delete all number values for Greta in row 8, the result changes to 4. Row 8 is no longer included in the count because it does not contain any values. The name Greta is text, not a value. Note that the DatabaseField parameter must point to a column that can contain values.

## DGET

DGET tagastab andmebaasi kuuluva viidatud lahtri, mis vastab määratud otsingukriteeriumitele, sisu. Vea korral tagastab funktsioon kas #VALUE!, kui ühtegi rida ei leitud, või Err502, kui leiti rohkem kui üks lahter.

The search supports wildcards or regular expressions. With regular expressions enabled, you can enter "all.*", for example to find the first location of "all" followed by any characters. If you want to search for a text that is also a regular expression, you must either precede every character with a "\" character, or enclose the text into \Q...\E. You can switch the automatic evaluation of wildcards or regular expression on and off in LibreOffice - PreferencesTools - Options - LibreOffice Calc - Calculate.

When using functions where one or more arguments are search criteria strings that represents a regular expression, the first attempt is to convert the string criteria to numbers. For example, ".0" will convert to 0.0 and so on. If successful, the match will not be a regular expression match but a numeric match. However, when switching to a locale where the decimal separator is not the dot makes the regular expression conversion work. To force the evaluation of the regular expression instead of a numeric expression, use some expression that can not be misread as numeric, such as ".[0]" or ".\0" or "(?i).0".

#### Süntaks

DGET(andmebaas; andmebaasi väli; otsingukriteeriumid)

For the DatabaseField parameter you can enter a reference to a header cell or a number to specify the column within the Database area, starting with 1. To reference a column by means of the literal column header name, place quotation marks around the header name.

#### Näide

Uurime ülaltoodud näite (keri ülespoole, palun) põhjal, mis klassis käib laps, kelle nimi on lahtris A14. Valemi sisestame jällegi lahtrisse B16 ja see erineb veidike varasematest näidetest, kuna ainult üks veerg (üks andmebaasi väli) tohib olla määratud andmebaasi väljana. Sisestame järgneva valemi:

=DGET(A1:E10;"Klass";A13:E14)

Nüüd sisestame nime Frank lahtrisse A14 ja näeme, et tulemus on 2. Frank on teises klassis. Sisestame "Klass" asemele Vanus ja saame vastuseks Franki vanuse.

Sisestame väärtuse 11 ainult lahtrisse C14 ja kustutame reast kõik ülejäänu. Muudame valemit lahtris B16 järgnevalt:

=DGET(A1:E10;"Nimi";A13:E14)

Klassi asemel küsime nüüd nime. Vastuseks saamegi Daniel: Daniel on ainus laps vanusega 11 aastat.

## DMAX

DMAX tagastab selle andmebaasi (kõikide kirjete hulka) kuuluva ja määratud otsingutingimustele vastava lahtri (välja) sisu, mis on teistega võrreldes suurim.

The search supports wildcards or regular expressions. With regular expressions enabled, you can enter "all.*", for example to find the first location of "all" followed by any characters. If you want to search for a text that is also a regular expression, you must either precede every character with a "\" character, or enclose the text into \Q...\E. You can switch the automatic evaluation of wildcards or regular expression on and off in LibreOffice - PreferencesTools - Options - LibreOffice Calc - Calculate.

When using functions where one or more arguments are search criteria strings that represents a regular expression, the first attempt is to convert the string criteria to numbers. For example, ".0" will convert to 0.0 and so on. If successful, the match will not be a regular expression match but a numeric match. However, when switching to a locale where the decimal separator is not the dot makes the regular expression conversion work. To force the evaluation of the regular expression instead of a numeric expression, use some expression that can not be misread as numeric, such as ".[0]" or ".\0" or "(?i).0".

#### Süntaks

DMAX(andmebaas; andmebaasi väli; otsingukriteeriumid)

For the DatabaseField parameter you can enter a reference to a header cell or a number to specify the column within the Database area, starting with 1. To reference a column by means of the literal column header name, place quotation marks around the header name.

#### Näide

Et leida, kui palju kaalub raskeim laps ülaltoodud näite (keri ülespoole, palun) igas klassis, sisestame lahtrisse B16 valemi:

=DMAX(A1:E10;"Kaal";A13:E14)

Nüüd sisestame väljale 'Klass' üksteise järel väärtused 1, 2, 3, jne. Pärast iga klassi numbri sisestamist ilmub vastuseväljale klassi raskeima lapse kaal.

## DMIN

DMIN tagastab selle andmebaasi (kõikide kirjete hulka) kuuluva ja määratud otsingutingimustele vastava lahtri (välja) sisu, mis on teistega võrreldes vähim.

The search supports wildcards or regular expressions. With regular expressions enabled, you can enter "all.*", for example to find the first location of "all" followed by any characters. If you want to search for a text that is also a regular expression, you must either precede every character with a "\" character, or enclose the text into \Q...\E. You can switch the automatic evaluation of wildcards or regular expression on and off in LibreOffice - PreferencesTools - Options - LibreOffice Calc - Calculate.

When using functions where one or more arguments are search criteria strings that represents a regular expression, the first attempt is to convert the string criteria to numbers. For example, ".0" will convert to 0.0 and so on. If successful, the match will not be a regular expression match but a numeric match. However, when switching to a locale where the decimal separator is not the dot makes the regular expression conversion work. To force the evaluation of the regular expression instead of a numeric expression, use some expression that can not be misread as numeric, such as ".[0]" or ".\0" or "(?i).0".

#### Süntaks

DMIN(andmebaas; andmebaasi väli; otsingukriteeriumid)

For the DatabaseField parameter you can enter a reference to a header cell or a number to specify the column within the Database area, starting with 1. To reference a column by means of the literal column header name, place quotation marks around the header name.

#### Näide

Et leida, kui pikk on igas ülaltoodud näite (keri ülespoole, palun) klassis selle õpilaste lühim koolitee, sisestame lahtrisse B16 järgmise valemi:

=DMIN(A1:E10;"Koolitee pikkus";A13:E14)

Reale 14, Klassi alla, sisestame järgemööda väärtused 1, 2, 3, jne. Vastuse väljale ilmub iga klassi lühima koolitee pikkus.

## DPRODUCT

DPRODUCT korrutab omavahel kõik need andmevahemiku lahtrid, mille sisu vastab otsingukriteeriumitele.

The search supports wildcards or regular expressions. With regular expressions enabled, you can enter "all.*", for example to find the first location of "all" followed by any characters. If you want to search for a text that is also a regular expression, you must either precede every character with a "\" character, or enclose the text into \Q...\E. You can switch the automatic evaluation of wildcards or regular expression on and off in LibreOffice - PreferencesTools - Options - LibreOffice Calc - Calculate.

When using functions where one or more arguments are search criteria strings that represents a regular expression, the first attempt is to convert the string criteria to numbers. For example, ".0" will convert to 0.0 and so on. If successful, the match will not be a regular expression match but a numeric match. However, when switching to a locale where the decimal separator is not the dot makes the regular expression conversion work. To force the evaluation of the regular expression instead of a numeric expression, use some expression that can not be misread as numeric, such as ".[0]" or ".\0" or "(?i).0".

#### Süntaks

DPRODUCT(andmebaas; andmebaasi väli; otsingukriteeriumid)

For the DatabaseField parameter you can enter a reference to a header cell or a number to specify the column within the Database area, starting with 1. To reference a column by means of the literal column header name, place quotation marks around the header name.

#### Näide

Ülaltoodud sünnipäevaliste näite (keri ülespoole, palun) jaoks ei ole sellel funktsioonil ühtegi mõistlikku rakendust.

## DSTDEV

DSTDEV arvutab valimil baseeruva populatsiooni, mis koosneb määratud tingimustele vastavatest andmebaasi veeru arvudest, standardhälbe. Kirjeid käsitletakse kui andmete valimit. "Meie" lapsed esindavad justkui läbilõiget kõikidest lastest (tõepärase resultaadi saamiseks peab valimi populatsiooni suurus olema üle tuhande).

The search supports wildcards or regular expressions. With regular expressions enabled, you can enter "all.*", for example to find the first location of "all" followed by any characters. If you want to search for a text that is also a regular expression, you must either precede every character with a "\" character, or enclose the text into \Q...\E. You can switch the automatic evaluation of wildcards or regular expression on and off in LibreOffice - PreferencesTools - Options - LibreOffice Calc - Calculate.

When using functions where one or more arguments are search criteria strings that represents a regular expression, the first attempt is to convert the string criteria to numbers. For example, ".0" will convert to 0.0 and so on. If successful, the match will not be a regular expression match but a numeric match. However, when switching to a locale where the decimal separator is not the dot makes the regular expression conversion work. To force the evaluation of the regular expression instead of a numeric expression, use some expression that can not be misread as numeric, such as ".[0]" or ".\0" or "(?i).0".

#### Süntaks

DSTDEV(andmebaas; andmebaasi väli; otsingukriteeriumid)

For the DatabaseField parameter you can enter a reference to a header cell or a number to specify the column within the Database area, starting with 1. To reference a column by means of the literal column header name, place quotation marks around the header name.

#### Näide

Et leida, kui suur on kõikide samaealiste ülaltoodud näite (keri ülespoole, palun) laste kaalu standardhälve, sisestame lahtrisse B16 järgmise valemi:

=DSTDEV(A1:E10;"Kaal";A13:E14)

Reale 14, Vanuse alla sisestame üksteise järel väärtused 7, 8, 9, jne. Vastuse väljale ilmub sama vanusega laste kaalude standardhälve.

## DSTDEVP

DSTDEVP arvutab populatsiooni, mis koosneb määratud tingimustele vastavatest andmevahemiku lahtritest, standardhälbe. Kirjeid meie näitest käsitletakse kui terviklikku populatsiooni.

The search supports wildcards or regular expressions. With regular expressions enabled, you can enter "all.*", for example to find the first location of "all" followed by any characters. If you want to search for a text that is also a regular expression, you must either precede every character with a "\" character, or enclose the text into \Q...\E. You can switch the automatic evaluation of wildcards or regular expression on and off in LibreOffice - PreferencesTools - Options - LibreOffice Calc - Calculate.

When using functions where one or more arguments are search criteria strings that represents a regular expression, the first attempt is to convert the string criteria to numbers. For example, ".0" will convert to 0.0 and so on. If successful, the match will not be a regular expression match but a numeric match. However, when switching to a locale where the decimal separator is not the dot makes the regular expression conversion work. To force the evaluation of the regular expression instead of a numeric expression, use some expression that can not be misread as numeric, such as ".[0]" or ".\0" or "(?i).0".

#### Süntaks

DSTDEVP(andmebaas; andmebaasi väli; otsingukriteeriumid)

For the DatabaseField parameter you can enter a reference to a header cell or a number to specify the column within the Database area, starting with 1. To reference a column by means of the literal column header name, place quotation marks around the header name.

#### Näide

Et leida, kui suur on kõikide samaealiste ülaltoodud näites (keri ülespoole, palun) Joe sünnipäevale kustutud laste kaalu standardhälve, sSisestame lahtrisse B16 järgmise valemi:

=DSTDEVP(A1:E10;"Kaal";A13:E14)

Reale 14, Vanuse alla, sisestame üksteise järel arvud 7, 8, 9, jne. Iga sisendi kohta näidatakse kõigi samaealiste laste, kelle kaalu me kontrollisime, kaalude standardhälvet.

## DSUM

DSUM tagastab andmebaasi välja kõikide ridade (kirjete) kõikide otsingukriteeriumitele vastavate lahtrite summa.

The search supports wildcards or regular expressions. With regular expressions enabled, you can enter "all.*", for example to find the first location of "all" followed by any characters. If you want to search for a text that is also a regular expression, you must either precede every character with a "\" character, or enclose the text into \Q...\E. You can switch the automatic evaluation of wildcards or regular expression on and off in LibreOffice - PreferencesTools - Options - LibreOffice Calc - Calculate.

When using functions where one or more arguments are search criteria strings that represents a regular expression, the first attempt is to convert the string criteria to numbers. For example, ".0" will convert to 0.0 and so on. If successful, the match will not be a regular expression match but a numeric match. However, when switching to a locale where the decimal separator is not the dot makes the regular expression conversion work. To force the evaluation of the regular expression instead of a numeric expression, use some expression that can not be misread as numeric, such as ".[0]" or ".\0" or "(?i).0".

#### Süntaks

DSUM(andmebaas; andmebaasi väli; otsingukriteeriumid)

For the DatabaseField parameter you can enter a reference to a header cell or a number to specify the column within the Database area, starting with 1. To reference a column by means of the literal column header name, place quotation marks around the header name.

#### Näide

Et leida, kui pikk on Joe sünnipäevale (keri ülespoole, palun) kutsutud teise klassi laste summaarne koolitee, sisestame lahtrisse B16 järgmise valemi:

=DSUM(A1:E10;"Koolitee pikkus";A13:E14)

Reale 14, Klassi alla, sisestame 2. Vastuseks näidatakse kõikide teises klassis käivate laste kooliteede pikkuste summat (1950).

## DVAR

DVAR tagastab kõikide andmebaasi välja lahtrite dispersiooni kõikide kirjete hulgas, mis vastavad määratud otsingukriteeriumitele. Kirjeid meie näitest käsitletakse kui andmete valimit. Tõepärase resultaadi saamiseks peab valimi populatsiooni suurus olema üle tuhande.

The search supports wildcards or regular expressions. With regular expressions enabled, you can enter "all.*", for example to find the first location of "all" followed by any characters. If you want to search for a text that is also a regular expression, you must either precede every character with a "\" character, or enclose the text into \Q...\E. You can switch the automatic evaluation of wildcards or regular expression on and off in LibreOffice - PreferencesTools - Options - LibreOffice Calc - Calculate.

When using functions where one or more arguments are search criteria strings that represents a regular expression, the first attempt is to convert the string criteria to numbers. For example, ".0" will convert to 0.0 and so on. If successful, the match will not be a regular expression match but a numeric match. However, when switching to a locale where the decimal separator is not the dot makes the regular expression conversion work. To force the evaluation of the regular expression instead of a numeric expression, use some expression that can not be misread as numeric, such as ".[0]" or ".\0" or "(?i).0".

#### Süntaks

DVAR(andmebaas; andmebaasi väli; otsingukriteeriumid)

For the DatabaseField parameter you can enter a reference to a header cell or a number to specify the column within the Database area, starting with 1. To reference a column by means of the literal column header name, place quotation marks around the header name.

#### Näide

Et leida, milline on ülaltoodud näite (keri ülespoole, palun) kõigi samaealiste laste kaalude dispersioon, sisestame lahtrisse B16 järgmise valemi:

=DVAR(A1:E10;"Kaal";A13:E14)

Reale 14, Vanuse alla, sisestame üksteise järel väärtused 7, 8, 9, jne. Vastusena näidatakse vastava vanusega laste kaalude dispersiooni.

## DVARP

DVARP arvutab kõikide andmebaasi välja lahtrite väärtuste dispersiooni kõikide kirjete hulgas, mis vastavad määratud otsingukriteeriumitele. Kirjeid meie näitest käsitletakse kui terviklikku populatsiooni.

The search supports wildcards or regular expressions. With regular expressions enabled, you can enter "all.*", for example to find the first location of "all" followed by any characters. If you want to search for a text that is also a regular expression, you must either precede every character with a "\" character, or enclose the text into \Q...\E. You can switch the automatic evaluation of wildcards or regular expression on and off in LibreOffice - PreferencesTools - Options - LibreOffice Calc - Calculate.

When using functions where one or more arguments are search criteria strings that represents a regular expression, the first attempt is to convert the string criteria to numbers. For example, ".0" will convert to 0.0 and so on. If successful, the match will not be a regular expression match but a numeric match. However, when switching to a locale where the decimal separator is not the dot makes the regular expression conversion work. To force the evaluation of the regular expression instead of a numeric expression, use some expression that can not be misread as numeric, such as ".[0]" or ".\0" or "(?i).0".

#### Süntaks

DVARP(andmebaas; andmebaasi väli; otsingukriteeriumid)

For the DatabaseField parameter you can enter a reference to a header cell or a number to specify the column within the Database area, starting with 1. To reference a column by means of the literal column header name, place quotation marks around the header name.

#### Näide

Et leida, milline on kõigi Joe sünnipäevale (keri ülespoole, palun) kutsutud samaealiste laste kaalude dispersioon, sisestame lahtrisse B16 järgmise valemi:

=DVARP(A1:E10;"Kaal";A13:E14)

Reale 14, Vanuse alla, sisestame üksteise järel väärtused 7, 8, 9, jne. Vastusena näidatakse Joe sünnipäevale kutsutud vastava vanusega laste kaalude dispersiooni.

Sarnased teemad

Functions by Category