summaryrefslogtreecommitdiffstats
path: root/helpcontent2/source/text/scalc/01/04060101.xhp
blob: 3e460b4e695ad6bdac620cc0a3882f85d041dd1b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
<?xml version="1.0" encoding="UTF-8"?>
<helpdocument version="1.0">

<!--
 * This file is part of the LibreOffice project.
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 *
 * This file incorporates work covered by the following license notice:
 *
 *   Licensed to the Apache Software Foundation (ASF) under one or more
 *   contributor license agreements. See the NOTICE file distributed
 *   with this work for additional information regarding copyright
 *   ownership. The ASF licenses this file to you under the Apache
 *   License, Version 2.0 (the "License"); you may not use this file
 *   except in compliance with the License. You may obtain a copy of
 *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
 -->


    <meta>
        <topic id="textscalc0104060101xml" indexer="include">
            <title xml-lang="en-US" id="tit">Database Functions</title>
            <filename>/text/scalc/01/04060101.xhp</filename>
        </topic>
    </meta>
    <body>
<bookmark xml-lang="en-US" branch="index" id="bm_id3148946">
    <bookmark_value>Function Wizard; databases</bookmark_value>
    <bookmark_value>functions; database functions</bookmark_value>
    <bookmark_value>databases; functions in $[officename] Calc</bookmark_value>
</bookmark>

        <h1 id="hd_id3148946">Database Functions</h1>
        <h3 id="hd_id721616440441374">Overview</h3>
        <paragraph xml-lang="en-US" id="par_id3145173" role="paragraph"><variable id="datenbanktext">The twelve functions in the Database category help you to analyze a simple database that occupies a rectangular spreadsheet area comprising columns and rows, with the data organized as one row for each record.</variable> The header cell of each column displays the name of the column and that name usually reflects the contents of each cell in that column.</paragraph>
        <paragraph role="paragraph" id="par_id631615842419413">The functions in the Database category take three arguments as follows:</paragraph>
        <list type="ordered">
            <listitem>
                <paragraph id="par_id761615842549780" role="listitem"><emph>Database</emph>. The cell range of the database.</paragraph>
            </listitem>
            <listitem>
                <paragraph id="par_id601615842657372" role="listitem"><emph>DatabaseField</emph>. The column containing the data to be used in the function’s calculations.</paragraph>
            </listitem>
            <listitem>
                <paragraph id="par_id471615842721059" role="listitem"><emph>SearchCriteria</emph>. The cell range of a separate area of the spreadsheet containing search criteria.</paragraph>
            </listitem>
        </list>
        <paragraph role="paragraph" id="par_id101615842794525">These arguments are described more fully below.</paragraph>
        <paragraph role="paragraph" id="par_id241615842810077">All functions have the same outline concept of operation. The first logical step is to use the specified <emph>SearchCriteria</emph> to identify the subset of records in the <emph>Database</emph> that are to be used during subsequent calculations. The second step is to extract the data values and perform the calculations associated with the specific function (average, sum, product, and so on). The values processed are those in the <emph>DatabaseField</emph> column of the selected records.</paragraph>
        <note id="par_id981615978852310">Calc treats dates and logical values (TRUE and FALSE) as numeric when calculating with these functions.</note>

        <h3 id="hd_id911615888814785">Database Function Arguments</h3>
        <paragraph role="paragraph" id="par_id911615888833104">The following argument definitions apply for all functions in the Database category:</paragraph>
        <list type="ordered">
            <listitem>
                <paragraph id="par_id21615889071992" role="listitem"><emph>Database argument</emph></paragraph>
                <paragraph role="paragraph" id="par_id31615889105463"><emph>Database</emph> specifies the range of cells occupied by the database table. The first row of the range contains the field names, and subsequent rows are records with corresponding field values.</paragraph>
                <paragraph role="paragraph" id="par_id521615889152497">One way of defining the range of cells is to enter the cell reference for the upper left-hand cell, followed by a colon (:), and then the lower right-hand cell reference. An example might be A1:E10.</paragraph>
                <paragraph role="paragraph" id="par_id761615889163416">The <emph>Database</emph> argument may also be specified by passing the name of a named range or database range. Using a meaningful name to define the cell range can enhance formula readability and document maintenance. If the name does not match the name of a defined range, Calc reports a #NAME? error.</paragraph>
                <paragraph role="paragraph" id="par_id601615889176137">Other errors that might be reported as a result of an invalid <emph>Database</emph> argument are #VALUE! and Err:504 (error in parameter list).</paragraph>
            </listitem>
            <listitem>
                <paragraph id="par_id201615889390777" role="listitem"><emph>DatabaseField argument</emph></paragraph>
                <paragraph role="paragraph" id="par_id431615889426480"><emph>DatabaseField</emph> specifies the column which the function will use for its calculations after the search criteria have been applied and the data rows have been selected. It is not related to the search criteria.</paragraph>
                <paragraph role="paragraph" id="par_id661615889458032">Specify the <emph>DatabaseField</emph> argument in any of the following ways:</paragraph>
                <section id="par_id191615890762881"><comment>Dummy section inserted to nest unordered list within ordered list.</comment>
                    <list type="unordered">
                        <listitem>
                            <paragraph id="par_id981615889517841" role="listitem">By entering a reference to a header cell within the <emph>Database</emph> area. Alternatively, if the cell has been given a meaningful name as a named range or database range, enter that name. If the name does not match the name of a defined range, Calc reports a #NAME? error. If the name is valid but does not correspond to one cell only, Calc reports Err:504 (error in parameter list).</paragraph>
                        </listitem>
                        <listitem>
                            <paragraph id="par_id551615889661457" role="listitem">By entering a number to specify the column within the <emph>Database</emph> area, starting with 1. For example, if a <emph>Database</emph> occupied the cell range D6:H123, then enter 3 to indicate the header cell at F6. Calc expects an integer value that lies between 1 and the number of columns defined within <emph>Database</emph> and ignores any digits after a decimal point. If the value is less than 1, Calc reports Err:504 (error in parameter list). If the value is greater than the number of columns in <emph>Database</emph>, Calc reports a #VALUE! error.</paragraph>
                        </listitem>
                        <listitem>
                            <paragraph id="par_id561615889738472" role="listitem">By entering the literal column header name from the first row of the <emph>Database</emph> range, placing quotation marks around the header name. For example, “Distance to School”. If the string does not match one of the <emph>Database</emph> area’s column headings, Calc reports Err:504 (error in parameter list). You can also provide a reference to an arbitrary cell (not within the <emph>Database</emph> and <emph>SearchCriteria</emph> areas) that contains the required string.</paragraph>
                        </listitem>
                    </list>
                </section>
                <paragraph role="paragraph" id="par_id181615889841279">The <emph>DatabaseField</emph> argument is optional for the DCOUNT and DCOUNTA functions but it is required for the other ten Database functions.</paragraph>
            </listitem>
            <listitem>
                <paragraph id="par_id841615891322513" role="listitem"><emph>SearchCriteria argument</emph></paragraph>
                <paragraph role="paragraph" id="par_id351615891337585"><emph>SearchCriteria</emph> specifies the range of cells containing search criteria. Like <emph>Database</emph>, its first row is also field names, and subsequent rows are conditions for related fields. The <emph>Database</emph> and <emph>SearchCriteria</emph> areas need not be adjacent, or even on the same sheet.</paragraph>
                <paragraph role="paragraph" id="par_id401615891342289">One way of defining the range of cells is to enter the cell reference for the upper left-hand cell, followed by a colon (:), and then the lower right-hand cell reference. For example, A13:B14. The cell range may also be specified by passing the name of a defined named range or database range. If the name does not match the name of a defined range, Calc reports a #NAME? error.</paragraph>
                <paragraph role="paragraph" id="par_id861615891345281">Err:504 (error in parameter list) may also be reported as a result of an invalid <emph>SearchCriteria</emph> argument.</paragraph>
                <paragraph role="paragraph" id="par_id901615891349688">The contents of the <emph>SearchCriteria</emph> area are described in more detail in the next section.</paragraph>
            </listitem>

        </list>

        <h3 id="hd_id481615892281210">Defining Search Criteria</h3>
        <paragraph role="paragraph" id="par_id691615892329680">The number of columns occupied by the <emph>SearchCriteria</emph> area need not be the same as the width of the <emph>Database</emph> area. All headings that appear in the first row of <emph>SearchCriteria</emph> must be identical to headings in the first row of <emph>Database</emph>. However, not all headings in <emph>Database</emph> need appear in the first row of <emph>SearchCriteria</emph>, while a heading in <emph>Database</emph> can appear multiple times in the first row of <emph>SearchCriteria</emph>.</paragraph>
        <paragraph role="paragraph" id="par_id541615892358897">Search criteria are entered into the cells of the second and subsequent rows of the <emph>SearchCriteria</emph> area, below the row containing headings. Blank cells within the <emph>SearchCriteria</emph> area are ignored.</paragraph>
        <paragraph role="paragraph" id="par_id151615892882441">Create criteria in the cells of the <emph>SearchCriteria</emph> area using the comparison operators &lt;, &lt;=, =, &lt;&gt;, &gt;=, and &gt;. = is assumed if a cell is not empty but does not start with a comparison operator.</paragraph>
        <paragraph role="paragraph" id="par_id561615893059337">If you write several criteria in one row, they are connected by AND. If you write several criteria in different rows, they are connected by OR.</paragraph>
        <paragraph role="paragraph" id="par_id401615893095178">Criteria can be created using wildcards, providing that wildcards have been enabled via the <menuitem>Enable wildcards in formulas</menuitem> option on the <link href="text/shared/optionen/01060500.xhp"><switchinline select="sys"><caseinline select="MAC"><menuitem>%PRODUCTNAME - Preferences</menuitem></caseinline><defaultinline><menuitem>Tools - Options</menuitem></defaultinline></switchinline><menuitem> - %PRODUCTNAME Calc - Calculate</menuitem></link> dialog. When interoperability with Microsoft Excel is important for your spreadsheet, this option should be enabled.</paragraph>
        <paragraph role="paragraph" id="par_id921615893158111">Even more powerful criteria can be created using regular expressions, providing that regular expressions have been enabled via the <menuitem>Enable regular expressions in formulas</menuitem>  option on the <link href="text/shared/optionen/01060500.xhp"><switchinline select="sys"><caseinline select="MAC"><menuitem>%PRODUCTNAME - Preferences</menuitem></caseinline><defaultinline><menuitem>Tools - Options</menuitem></defaultinline></switchinline><menuitem> - %PRODUCTNAME Calc - Calculate</menuitem></link> dialog.</paragraph>

        <embed href="text/shared/00/00000001.xhp#regexnumex"/>

        <paragraph role="paragraph" id="par_id881615893236930">Another setting that affects how the search criteria are handled is the <menuitem>Search criteria = and &lt;&gt; must apply to whole cells</menuitem>  option on the <link href="text/shared/optionen/01060500.xhp"><switchinline select="sys"><caseinline select="MAC"><menuitem>%PRODUCTNAME - Preferences</menuitem></caseinline><defaultinline><menuitem>Tools - Options</menuitem></defaultinline></switchinline><menuitem> - %PRODUCTNAME Calc - Calculate</menuitem></link> dialog. This option controls whether the search criteria you set for the Database functions must match the whole cell exactly. When interoperability with Microsoft Excel is important for your spreadsheet, this option should be enabled.</paragraph>

        <h3 id="hd_id3150329">Examples of Database Function Use</h3>
        <paragraph xml-lang="en-US" id="par_id3153713" role="paragraph">The following table provides an example database table that is utilized to demonstrate how to use the functions in the Database category. The cell range A1:E10 contains fictitious information about the guests invited to Joe's birthday party. The following information is given for each guest - name, school grade, age in years, distance to school in meters, and weight in kilograms.</paragraph>

        <table id="tbl_id3159264">
            <tablerow>
                <tablecell></tablecell>
                <tablecell>
                    <paragraph xml-lang="en-US" id="par_id3145232" localize="false" role="tablehead">A</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph xml-lang="en-US" id="par_id3146316" localize="false" role="tablehead">B</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph xml-lang="en-US" id="par_id3150297" localize="false" role="tablehead">C</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph xml-lang="en-US" id="par_id3150344" localize="false" role="tablehead">D</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph xml-lang="en-US" id="par_id3150785" localize="false" role="tablehead">E</paragraph>
                </tablecell>
            </tablerow>
            <tablerow>
                <tablecell>
                    <paragraph xml-lang="en-US" id="par_id3150090" localize="false" role="tablehead">1</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph xml-lang="en-US" id="par_id3152992" role="tablecontent"><emph>Name</emph></paragraph>
                </tablecell>
                <tablecell>
                    <paragraph xml-lang="en-US" id="par_id3155532" role="tablecontent"><emph>Grade</emph></paragraph>
                </tablecell>
                <tablecell>
                    <paragraph xml-lang="en-US" id="par_id3156448" role="tablecontent"><emph>Age</emph></paragraph>
                </tablecell>
                <tablecell>
                    <paragraph xml-lang="en-US" id="par_id3154486" role="tablecontent"><emph>Distance</emph></paragraph>
                </tablecell>
                <tablecell>
                    <paragraph xml-lang="en-US" id="par_id3152899" role="tablecontent"><emph>Weight</emph></paragraph>
                </tablecell>
            </tablerow>
            <tablerow>
                <tablecell>
                    <paragraph xml-lang="en-US" id="par_id3153816" localize="false" role="tablehead">2</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph xml-lang="en-US" id="par_id3151240" role="tablecontent">Andy</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph xml-lang="en-US" id="par_id3156016" localize="false" role="tablecontent">3</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph xml-lang="en-US" id="par_id3145073" localize="false" role="tablecontent">9</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph xml-lang="en-US" id="par_id3154956" localize="false" role="tablecontent">150</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph xml-lang="en-US" id="par_id3153976" localize="false" role="tablecontent">40</paragraph>
                </tablecell>
            </tablerow>
            <tablerow>
                <tablecell>
                    <paragraph xml-lang="en-US" id="par_id3150894" localize="false" role="tablehead">3</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph xml-lang="en-US" id="par_id3152870" role="tablecontent">Betty</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph xml-lang="en-US" id="par_id3149692" localize="false" role="tablecontent">4</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph xml-lang="en-US" id="par_id3154652" localize="false" role="tablecontent">10</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph xml-lang="en-US" id="par_id3149381" localize="false" role="tablecontent">1000</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph xml-lang="en-US" id="par_id3153812" localize="false" role="tablecontent">42</paragraph>
                </tablecell>
            </tablerow>
            <tablerow>
                <tablecell>
                    <paragraph xml-lang="en-US" id="par_id3146965" localize="false" role="tablehead">4</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph xml-lang="en-US" id="par_id3155596" role="tablecontent">Charles</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph xml-lang="en-US" id="par_id3147244" localize="false" role="tablecontent">3</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph xml-lang="en-US" id="par_id3149871" localize="false" role="tablecontent">10</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph xml-lang="en-US" id="par_id3155752" localize="false" role="tablecontent">300</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph xml-lang="en-US" id="par_id3149052" localize="false" role="tablecontent">51</paragraph>
                </tablecell>
            </tablerow>
            <tablerow>
                <tablecell>
                    <paragraph xml-lang="en-US" id="par_id3146097" localize="false" role="tablehead">5</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph xml-lang="en-US" id="par_id3147296" role="tablecontent">Daniel</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph xml-lang="en-US" id="par_id3150393" localize="false" role="tablecontent">5</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph xml-lang="en-US" id="par_id3145236" localize="false" role="tablecontent">11</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph xml-lang="en-US" id="par_id3150534" localize="false" role="tablecontent">1200</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph xml-lang="en-US" id="par_id3150375" localize="false" role="tablecontent">48</paragraph>
                </tablecell>
            </tablerow>
            <tablerow>
                <tablecell>
                    <paragraph xml-lang="en-US" id="par_id3159121" localize="false" role="tablehead">6</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph xml-lang="en-US" id="par_id3150456" role="tablecontent">Eva</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph xml-lang="en-US" id="par_id3146886" localize="false" role="tablecontent">2</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph xml-lang="en-US" id="par_id3149945" localize="false" role="tablecontent">8</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph xml-lang="en-US" id="par_id3157904" localize="false" role="tablecontent">650</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph xml-lang="en-US" id="par_id3149352" localize="false" role="tablecontent">33</paragraph>
                </tablecell>
            </tablerow>
            <tablerow>
                <tablecell>
                    <paragraph xml-lang="en-US" id="par_id3150028" localize="false" role="tablehead">7</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph xml-lang="en-US" id="par_id3145826" role="tablecontent">Frank</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph xml-lang="en-US" id="par_id3150743" localize="false" role="tablecontent">2</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph xml-lang="en-US" id="par_id3154844" localize="false" role="tablecontent">7</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph xml-lang="en-US" id="par_id3148435" localize="false" role="tablecontent">300</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph xml-lang="en-US" id="par_id3148882" localize="false" role="tablecontent">42</paragraph>
                </tablecell>
            </tablerow>
            <tablerow>
                <tablecell>
                    <paragraph xml-lang="en-US" id="par_id3150140" localize="false" role="tablehead">8</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph xml-lang="en-US" id="par_id3146137" role="tablecontent">Greta</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph xml-lang="en-US" id="par_id3148739" localize="false" role="tablecontent">1</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph xml-lang="en-US" id="par_id3148583" localize="false" role="tablecontent">7</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph xml-lang="en-US" id="par_id3154556" localize="false" role="tablecontent">200</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph xml-lang="en-US" id="par_id3155255" localize="false" role="tablecontent">36</paragraph>
                </tablecell>
            </tablerow>
            <tablerow>
                <tablecell>
                    <paragraph xml-lang="en-US" id="par_id3145141" localize="false" role="tablehead">9</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph xml-lang="en-US" id="par_id3153078" role="tablecontent">Harry</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph xml-lang="en-US" id="par_id3149955" localize="false" role="tablecontent">3</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph xml-lang="en-US" id="par_id3150005" localize="false" role="tablecontent">9</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph xml-lang="en-US" id="par_id3155951" localize="false" role="tablecontent">1200</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph xml-lang="en-US" id="par_id3145169" localize="false" role="tablecontent">44</paragraph>
                </tablecell>
            </tablerow>
            <tablerow>
                <tablecell>
                    <paragraph xml-lang="en-US" id="par_id3153571" localize="false" role="tablehead">10</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph xml-lang="en-US" id="par_id3148761" role="tablecontent">Irene</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph xml-lang="en-US" id="par_id3149877" localize="false" role="tablecontent">2</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph xml-lang="en-US" id="par_id3154327" localize="false" role="tablecontent">8</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph xml-lang="en-US" id="par_id3155435" localize="false" role="tablecontent">1000</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph xml-lang="en-US" id="par_id3145353" localize="false" role="tablecontent">42</paragraph>
                </tablecell>
            </tablerow>
            <tablerow>
                <tablecell>
                    <paragraph xml-lang="en-US" id="par_id3150662" localize="false" role="tablehead">11</paragraph>
                </tablecell>
                <tablecell>
                </tablecell>
                <tablecell>
                </tablecell>
                <tablecell>
                </tablecell>
                <tablecell>
                </tablecell>
                <tablecell>
                </tablecell>
            </tablerow>
        </table>

        <paragraph role="paragraph" id="par_id221616245476190">The following six examples use the database table above, combined with different search criteria areas.</paragraph>

        <h4 id="hd_id861616245631924">Example 1</h4>
        <table id="tab_id191616245640932">
            <tablerow>
                <tablecell>
                </tablecell>
                <tablecell>
                    <paragraph id="par_id441616245640933" localize="false" role="tablehead">A</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph id="par_id291616245640933" localize="false" role="tablehead">B</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph id="par_id881616245705884" localize="false" role="tablehead">C</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph id="par_id301616245711996" localize="false" role="tablehead">D</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph id="par_id191616245715444" localize="false" role="tablehead">E</paragraph>
                </tablecell>
            </tablerow>
            <tablerow>
                <tablecell>
                    <paragraph id="par_id841616245640933" localize="false" role="tablehead">12</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph id="par_id891616245640933" role="tablecontent"><emph>Name</emph></paragraph>
                </tablecell>
                <tablecell>
                    <paragraph id="par_id451616245640933" role="tablecontent"><emph>Grade</emph></paragraph>
                </tablecell>
                <tablecell>
                    <paragraph id="par_id151616245818988" role="tablecontent"><emph>Age</emph></paragraph>
                </tablecell>
                <tablecell>
                    <paragraph id="par_id481616245878460" role="tablecontent"><emph>Distance</emph></paragraph>
                </tablecell>
                <tablecell>
                    <paragraph id="par_id741616245891772" role="tablecontent"><emph>Weight</emph></paragraph>
                </tablecell>
            </tablerow>
            <tablerow>
                <tablecell>
                    <paragraph id="par_id641616245660252" localize="false" role="tablehead">13</paragraph>
                </tablecell>
                <tablecell>
                </tablecell>
                <tablecell>
                </tablecell>
                <tablecell>
                </tablecell>
                <tablecell>
                    <paragraph id="par_id41616246075884" localize="false" role="tablecontent">&gt;600</paragraph>
                </tablecell>
                <tablecell>
                </tablecell>
            </tablerow>
            <tablerow>
                <tablecell>
                    <paragraph id="par_id321616245665844" localize="false" role="tablehead">14</paragraph>
                </tablecell>
                <tablecell>
                </tablecell>
                <tablecell>
                </tablecell>
                <tablecell>
                </tablecell>
                <tablecell>
                </tablecell>
                <tablecell>
                </tablecell>
            </tablerow>
        </table>

        <paragraph role="paragraph" id="par_id451616246535763">As in this simple example, it is sometimes desirable (but not essential) to place the search criteria area directly under the database table, with the columns of the two areas vertically aligned. Blank entries in the search criteria area are ignored. With the above example database table and this search criteria area, insert the formula <item type="input">=DCOUNT(A1:E10;;A12:E14)</item> into an empty cell elsewhere in the sheet to count how many of Joe’s guests travel further than 600 meters to school. The value 5 is returned (counting Betty, Daniel, Eva, Harry, and Irene).</paragraph>
        <paragraph role="paragraph" id="par_id731616246561901">Note also that the formula <item type="input">=DCOUNT(A1:E10;;D12:D13)</item> returns exactly the same value, demonstrating that it is only necessary for the search criteria area to contain relevant column headings. </paragraph>
        <h4 id="hd_id191616246773750">Example 2</h4>

        <table id="tab_id861616246804093">
            <tablerow>
                <tablecell>
                </tablecell>
                <tablecell>
                    <paragraph id="par_id951616246804093" localize="false" role="tablehead">&#160;&#160;&#160;A&#160;&#160;&#160;</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph id="par_id411616246804093" localize="false" role="tablehead">&#160;&#160;&#160;B&#160;&#160;&#160;</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph id="par_id581616246838019" localize="false" role="tablehead">&#160;&#160;&#160;C&#160;&#160;&#160;</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph id="par_id421616246860604" localize="false" role="tablehead">&#160;&#160;&#160;D&#160;&#160;&#160;</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph id="par_id371616246868876" localize="false" role="tablehead">&#160;&#160;&#160;E&#160;&#160;&#160;</paragraph>
                </tablecell>
            </tablerow>
            <tablerow>
                <tablecell>
                    <paragraph id="par_id401616246804093" localize="false" role="tablehead">12</paragraph>
                </tablecell>
                <tablecell>
                </tablecell>
                <tablecell>
                    <paragraph id="par_id71616246804093" role="tablecontent"><emph>Age</emph></paragraph>
                </tablecell>
                <tablecell>
                    <paragraph id="par_id41616250394431" role="tablecontent"><emph>Grade</emph></paragraph>
                </tablecell>
                <tablecell>
                </tablecell>
                <tablecell>
                </tablecell>
            </tablerow>
            <tablerow>
                <tablecell>
                    <paragraph id="par_id991616250406886" localize="false" role="tablehead">13</paragraph>
                </tablecell>
                <tablecell>
                </tablecell>
                <tablecell>
                    <paragraph id="par_id71616250414319" localize="false" role="tablecontent">&gt;7</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph id="par_id531616250419463" localize="false" role="tablecontent">2</paragraph>
                </tablecell>
                <tablecell>
                </tablecell>
                <tablecell>
                </tablecell>
            </tablerow>
            <tablerow>
                <tablecell>
                    <paragraph id="par_id831616251223575" localize="false" role="tablehead">14</paragraph>
                </tablecell>
                <tablecell>
                </tablecell>
                <tablecell>
                </tablecell>
                <tablecell>
                </tablecell>
                <tablecell>
                </tablecell>
                <tablecell>
                </tablecell>
            </tablerow>
        </table>

        <paragraph role="paragraph" id="par_id361616251794063">In this example the search criteria area contains only two headings and these are not vertically aligned with the corresponding headings in the example database table. Since there are two conditions in the same row, these are connected by AND. With the above example database table and this search criteria area, insert the formula <item type="input">=DCOUNT(A1:E10;;B12:C13)</item> into an empty cell elsewhere in the sheet to count how many of Joe’s guests are in grade 2 and greater than 7 years old. The value 2 is returned (counting Eva and Irene).</paragraph>

        <h4 id="hd_id221616251986854">Example 3</h4>

        <table id="tab_id851616251871487">
            <tablerow>
                <tablecell>
                </tablecell>
                <tablecell>
                    <paragraph id="par_id21616251871487" localize="false" role="tablehead">&#160;&#160;&#160;A&#160;&#160;&#160;</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph id="par_id311616251871487" localize="false" role="tablehead">&#160;&#160;&#160;B&#160;&#160;&#160;</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph id="par_id191616251892502" localize="false" role="tablehead">&#160;&#160;&#160;C&#160;&#160;&#160;</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph id="par_id761616251895935" localize="false" role="tablehead">&#160;&#160;&#160;D&#160;&#160;&#160;</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph id="par_id711616251899470" localize="false" role="tablehead">&#160;&#160;&#160;E&#160;&#160;&#160;</paragraph>
                </tablecell>
            </tablerow>
            <tablerow>
                <tablecell>
                    <paragraph id="par_id431616251871487" localize="false" role="tablehead">12</paragraph>
                </tablecell>
                <tablecell>
                </tablecell>
                <tablecell>
                    <paragraph id="par_id141616251871487" role="tablecontent"><emph>Age</emph></paragraph>
                </tablecell>
                <tablecell>
                </tablecell>
                <tablecell>
                </tablecell>
                <tablecell>
                </tablecell>
            </tablerow>
            <tablerow>
                <tablecell>
                    <paragraph id="par_id471616251933256" localize="false" role="tablehead">13</paragraph>
                </tablecell>
                <tablecell>
                </tablecell>
                <tablecell>
                    <paragraph id="par_id211616251944567" localize="false" role="tablecontent">9</paragraph>
                </tablecell>
                <tablecell>
                </tablecell>
                <tablecell>
                </tablecell>
                <tablecell>
                </tablecell>
            </tablerow>
            <tablerow>
                <tablecell>
                    <paragraph id="par_id31616252165976" localize="false" role="tablehead">14</paragraph>
                </tablecell>
                <tablecell>
                </tablecell>
                <tablecell>
                    <paragraph id="par_id921616252172663" localize="false" role="tablecontent">10</paragraph>
                </tablecell>
                <tablecell>
                </tablecell>
                <tablecell>
                </tablecell>
                <tablecell>
                </tablecell>
            </tablerow>
        </table>

        <paragraph role="paragraph" id="par_id351616252313215">In this example the search criteria area contains only one heading. Since there are two conditions in consecutive rows, these are connected by OR. With the above example database table and this search criteria area, insert the formula <item type="input">=DCOUNT(A1:E10;;B12:B14)</item> into an empty cell elsewhere in the sheet to count how many of Joe’s guests are either 9 or 10 years old. The value 4 is returned (counting Andy, Betty, Charles, and Harry).</paragraph>

        <h4 id="hd_id71616252395407">Example 4 </h4>
        <table id="tab_id741616252413665">
            <tablerow>
                <tablecell>
                </tablecell>
                <tablecell>
                    <paragraph id="par_id361616252413665" localize="false" role="tablehead">&#160;&#160;&#160;A&#160;&#160;&#160;</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph id="par_id991616252413665" localize="false" role="tablehead">&#160;&#160;&#160;B&#160;&#160;&#160;</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph id="par_id111616252426590" localize="false" role="tablehead">&#160;&#160;&#160;C&#160;&#160;&#160;</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph id="par_id771616252429942" localize="false" role="tablehead">&#160;&#160;&#160;D&#160;&#160;&#160;</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph id="par_id651616252434463" localize="false" role="tablehead">&#160;&#160;&#160;E&#160;&#160;&#160;</paragraph>
                </tablecell>
            </tablerow>
            <tablerow>
                <tablecell>
                    <paragraph id="par_id131616252413665" localize="false" role="tablehead">12</paragraph>
                </tablecell>
                <tablecell>
                </tablecell>
                <tablecell>
                    <paragraph id="par_id451616252413665" role="tablecontent"><emph>Age</emph></paragraph>
                </tablecell>
                <tablecell>
                    <paragraph id="par_id431616252540783" role="tablecontent"><emph>Age</emph></paragraph>
                </tablecell>
                <tablecell>
                </tablecell>
                <tablecell>
                </tablecell>
            </tablerow>
            <tablerow>
                <tablecell>
                    <paragraph id="par_id591616252561087" localize="false" role="tablehead">13</paragraph>
                </tablecell>
                <tablecell>
                </tablecell>
                <tablecell>
                    <paragraph id="par_id411616252568693" localize="false" role="tablecontent">&gt;=8</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph id="par_id441616252573495" localize="false" role="tablecontent">&lt;=10</paragraph>
                </tablecell>
                <tablecell>
                </tablecell>
                <tablecell>
                </tablecell>
            </tablerow>
            <tablerow>
                <tablecell>
                    <paragraph id="par_id841616252597982" localize="false" role="tablehead">14</paragraph>
                </tablecell>
                <tablecell>
                </tablecell>
                <tablecell>
                </tablecell>
                <tablecell>
                </tablecell>
                <tablecell>
                </tablecell>
                <tablecell>
                </tablecell>
            </tablerow>
        </table>

        <paragraph role="paragraph" id="par_id991616252981928">In this example the search criteria area contains two occurrences of the same heading. Since there are two conditions in the same row, these are connected by AND. With the above example database table and this search criteria area, insert the formula <item type="input">=DCOUNT(A1:E10;;B12:C13)</item> into an empty cell elsewhere in the sheet to count how many of Joe’s guests are aged between 8 and 10 (inclusive). The value 6 is returned (counting Andy, Betty, Charles, Eva, Harry, and Irene).  </paragraph>

        <h4 id="hd_id561616253067881">Example 5</h4>
        <table id="tab_id601616253073598">
            <tablerow>
                <tablecell>
                </tablecell>
                <tablecell>
                    <paragraph id="par_id981616253073598" localize="false" role="tablehead">&#160;&#160;&#160;A&#160;&#160;&#160;</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph id="par_id851616253073598" localize="false" role="tablehead">&#160;&#160;&#160;B&#160;&#160;&#160;</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph id="par_id681616253083615" localize="false" role="tablehead">&#160;&#160;&#160;C&#160;&#160;&#160;</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph id="par_id711616253086822" localize="false" role="tablehead">&#160;&#160;&#160;D&#160;&#160;&#160;</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph id="par_id231616253091555" localize="false" role="tablehead">&#160;&#160;&#160;E&#160;&#160;&#160;</paragraph>
                </tablecell>
            </tablerow>
            <tablerow>
                <tablecell>
                    <paragraph id="par_id681616253073598" localize="false" role="tablehead">12</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph id="par_id301616253073598" role="tablecontent"><emph>Name</emph></paragraph>
                </tablecell>
                <tablecell>
                </tablecell>
                <tablecell>
                </tablecell>
                <tablecell>
                </tablecell>
                <tablecell>
                </tablecell>
            </tablerow>
            <tablerow>
                <tablecell>
                    <paragraph id="par_id231616253246590" localize="false" role="tablehead">13</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph id="par_id251616253264022" localize="false" role="tablecontent">F*</paragraph>
                </tablecell>
                <tablecell>
                </tablecell>
                <tablecell>
                </tablecell>
                <tablecell>
                </tablecell>
                <tablecell>
                </tablecell>
            </tablerow>
            <tablerow>
                <tablecell>
                    <paragraph id="par_id501616253322927" localize="false" role="tablehead">14</paragraph>
                </tablecell>
                <tablecell>
                </tablecell>
                <tablecell>
                </tablecell>
                <tablecell>
                </tablecell>
                <tablecell>
                </tablecell>
                <tablecell>
                </tablecell>
            </tablerow>
        </table>

        <paragraph role="paragraph" id="par_id91616253394127">This simple example shows the use of wildcards. For this example to work as intended, select to enable wildcards at <link href="text/shared/optionen/01060500.xhp"><switchinline select="sys"><caseinline select="MAC"><menuitem>%PRODUCTNAME - Preferences</menuitem></caseinline><defaultinline><menuitem>Tools - Options</menuitem></defaultinline></switchinline><menuitem> - %PRODUCTNAME Calc - Calculate</menuitem></link>. With the above example database table and this search criteria area, insert the formula <item type="input">=DCOUNT(A1:E10;;A12:A13)</item> into an empty cell elsewhere in the sheet to count how many of Joe’s guests have names that begin with the letter “F”. The value 1 is returned (counting Frank).</paragraph>


        <h4 id="hd_id121616253593255">Example 6</h4>
        <table id="tab_id441616253599063">
            <tablerow>
                <tablecell>
                </tablecell>
                <tablecell>
                    <paragraph id="par_id691616253599063" localize="false" role="tablehead">&#160;&#160;&#160;A&#160;&#160;&#160;</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph id="par_id231616253599063" localize="false" role="tablehead">&#160;&#160;&#160;B&#160;&#160;&#160;</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph id="par_id401616253606239" localize="false" role="tablehead">&#160;&#160;&#160;C&#160;&#160;&#160;</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph id="par_id661616253609823" localize="false" role="tablehead">&#160;&#160;&#160;D&#160;&#160;&#160;</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph id="par_id581616253613127" localize="false" role="tablehead">&#160;&#160;&#160;E&#160;&#160;&#160;</paragraph>
                </tablecell>
            </tablerow>
            <tablerow>
                <tablecell>
                    <paragraph id="par_id191616253599063" localize="false" role="tablehead">12</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph id="par_id731616253599063" role="tablecontent"><emph>Name</emph></paragraph>
                </tablecell>
                <tablecell>
                </tablecell>
                <tablecell>
                </tablecell>
                <tablecell>
                </tablecell>
                <tablecell>
                </tablecell>
            </tablerow>
            <tablerow>
                <tablecell>
                    <paragraph id="par_id391616253645567" localize="false" role="tablehead">13</paragraph>
                </tablecell>
                <tablecell>
                    <paragraph id="par_id761616253649791" localize="false" role="tablecontent">[ABC].*</paragraph>
                </tablecell>
                <tablecell>
                </tablecell>
                <tablecell>
                </tablecell>
                <tablecell>
                </tablecell>
                <tablecell>
                </tablecell>
            </tablerow>
            <tablerow>
                <tablecell>
                    <paragraph id="par_id301616253665959" localize="false" role="tablehead">14</paragraph>
                </tablecell>
                <tablecell>
                </tablecell>
                <tablecell>
                </tablecell>
                <tablecell>
                </tablecell>
                <tablecell>
                </tablecell>
                <tablecell>
                </tablecell>
            </tablerow>
        </table>

        <paragraph role="paragraph" id="par_id631616253692350">This simple example shows the use of regular expressions. For this example to work as intended, select to enable regular expressions at <link href="text/shared/optionen/01060500.xhp"><switchinline select="sys"><caseinline select="MAC"><menuitem>%PRODUCTNAME - Preferences</menuitem></caseinline><defaultinline><menuitem>Tools - Options</menuitem></defaultinline></switchinline><menuitem> - %PRODUCTNAME Calc - Calculate</menuitem></link>. With the above example database table and this search criteria area, insert the formula <item type="input">=DCOUNT(A1:E10;;A12:A13)</item> into an empty cell elsewhere in the sheet to count how many of Joe’s guests have names that begin with the letters “A”, “B”, or “C”. The value 3 is returned (counting Andy, Betty, and Charles).</paragraph>

        <sort order="asc" descendant="h2">
            <section id="Section1">
<bookmark xml-lang="en-US" branch="index" id="bm_id3150882">
<bookmark_value>DCOUNT function</bookmark_value>
<bookmark_value>counting rows;with numeric values</bookmark_value>
</bookmark><comment>mw added "counting rows;"</comment>
<bookmark xml-lang="en-US" branch="hid/SC_HID_FUNC_DBANZAHL" id="bm_id3152926" localize="false"/>
                <h2 id="hd_id3150882">DCOUNT</h2>
                <paragraph xml-lang="en-US" id="par_id3156133" role="paragraph"><ahelp hid="HID_FUNC_DBANZAHL">DCOUNT counts the number of cells (fields) of the specified column that contain numeric values, for all rows (database records) that match the specified search criteria.</ahelp> However, if no column is specified, DCOUNT returns the count of all records that match the specified search criteria irrespective of their contents.</paragraph>

                <embed href="text/scalc/01/common_func.xhp#sectionsyntax"/>
                <paragraph xml-lang="en-US" id="par_id3153218" role="code">DCOUNT(Database; [DatabaseField]; SearchCriteria)</paragraph>

                <embed href="text/scalc/01/common_func.xhp#sectionexample"/>
                <paragraph xml-lang="en-US" id="par_id3153623" role="paragraph">The example database table giving information about the guests invited to Joe’s birthday party (described above) should occupy cells A1:E10. The content of cells A12:E12 should be identical to the header labels for the database table in cells A1:E1. Make sure that cells A13:E13 are blank, except for cell D13 which should contain ">600" (this search criterion will match records in the database table that have a value greater than 600 in the Distance column).</paragraph>
                <paragraph role="paragraph" id="par_id441616368480646">Insert the formula <input>=DCOUNT(A1:E10;; A12:E13)</input> into an empty cell elsewhere in the sheet to calculate how many of Joe’s party guests travel further than 600 meters to school. The value 5 is returned.</paragraph>
                <paragraph role="paragraph" id="par_id361616368488119">The same result is obtained if you use the formula <input>=DCOUNT(A1:E10; "Distance"; A12:E13)</input>, because all entries in the Distance column are numeric. However, if you use the formula <input>=DCOUNT(A1:E10; "Name"; A12:E13)</input>, the value 0 is returned because all entries in the Name column are non-numeric.</paragraph>
            </section>

            <section id="Section2">
<bookmark xml-lang="en-US" branch="index" id="bm_id3156123">
<bookmark_value>DCOUNTA function</bookmark_value>
<bookmark_value>records;counting in Calc databases</bookmark_value>
<bookmark_value>counting rows;with numeric or alphanumeric values</bookmark_value>
</bookmark><comment>mw added "records;" and "counting rows;"</comment>
<bookmark xml-lang="en-US" branch="hid/SC_HID_FUNC_DBANZAHL2" id="bm_id3154055" localize="false"/>
                <h2 id="hd_id3156123">DCOUNTA</h2>
                <paragraph xml-lang="en-US" id="par_id3156110" role="paragraph"><ahelp hid="HID_FUNC_DBANZAHL2">DCOUNTA counts the number of cells (fields) of the specified column that are not blank, for all rows (database records) that match the specified search criteria.</ahelp> Blank cells of the specified column are not counted. However, if no column is specified, DCOUNTA returns the count of all records that match the specified search criteria irrespective of their contents.</paragraph>

                <embed href="text/scalc/01/common_func.xhp#sectionsyntax"/>
                <paragraph xml-lang="en-US" id="par_id3146893" role="code">DCOUNTA(Database; [DatabaseField]; SearchCriteria)</paragraph>

                <embed href="text/scalc/01/common_func.xhp#sectionexample"/>
                <paragraph xml-lang="en-US" id="par_id3153982" role="paragraph">The example database table giving information about the guests invited to Joe’s birthday party (described above) should occupy cells A1:E10. The content of cells A12:E12 should be identical to the header labels for the database table in cells A1:E1. Make sure that cells A13:E13 are blank, except for cell D13 which should contain ">600" (this search criterion will match records in the database table that have a value greater than 600 in the Distance column).</paragraph>
                <paragraph role="paragraph" id="par_id61616368616093">Insert the formula <input>=DCOUNTA(A1:E10;; A12:E13)</input> into an empty cell elsewhere in the sheet to calculate how many of Joe’s party guests travel further than 600 meters to school. The value 5 is returned.</paragraph>
                <paragraph role="paragraph" id="par_id841616368623207">The same result is obtained if you use the formula <input>=DCOUNTA(A1:E10; "Distance"; A12:E13)</input> or the formula <input>=DCOUNTA(A1:E10; "Name"; A12:E13)</input>. The latter case reflects that in contrast to DCOUNT, DCOUNTA counts both numeric and alphanumeric values in the column indicated by the <emph>DatabaseField</emph> argument.</paragraph>
            </section>

            <section id="Section3">
<bookmark xml-lang="en-US" branch="index" id="bm_id3147256">
<bookmark_value>DGET function</bookmark_value>
<bookmark_value>cell contents;searching in Calc databases</bookmark_value>
<bookmark_value>searching;cell contents in Calc databases</bookmark_value>
</bookmark><comment>mw added "cell contents;" and "searching;"</comment>
<bookmark xml-lang="en-US" branch="hid/SC_HID_FUNC_DBAUSZUG" id="bm_id3149198" localize="false"/>
                <h2 id="hd_id3147256">DGET</h2>
                <paragraph xml-lang="en-US" id="par_id3152801" role="paragraph"><ahelp hid="HID_FUNC_DBAUSZUG">DGET returns the contents of the cell (field) of the specified column, for the single row (database record) that matches the specified search criteria.</ahelp></paragraph>
                <paragraph role="paragraph" id="par_id171616180137385">Calc reports Err:502 (invalid argument) if multiple matches are found, or a #VALUE! error (wrong data type) if no matches are found. A #VALUE! error is also reported if a single match is found but the relevant cell is empty.</paragraph>

                <embed href="text/scalc/01/common_func.xhp#sectionsyntax"/>
                <paragraph xml-lang="en-US" id="par_id3154696" role="code">DGET(Database; DatabaseField; SearchCriteria)</paragraph>

                <embed href="text/scalc/01/common_func.xhp#sectionexample"/>
                <paragraph xml-lang="en-US" id="par_id3155388" role="paragraph">The example database table giving information about the guests invited to Joe’s birthday party (described above) should occupy cells A1:E10. The content of cells A12:E12 should be identical to the header labels for the database table in cells A1:E1. Make sure that cells A13:E13 are blank, except for cell C13 which should contain "11" (this search criterion will match records in the database table that have a value of 11 in the Age column).</paragraph>
                <paragraph xml-lang="en-US" id="par_id3153096" role="paragraph">Insert the formula <input>=DGET(A1:E10; "Name"; A12:E13)</input> into an empty cell elsewhere in the sheet to find the name of Joe’s party guest who is age 11. The name Daniel is returned.</paragraph>
                <paragraph xml-lang="en-US" id="par_id3150524" role="paragraph">If you change the value in cell C13 to “10”, then the formula <input>=DGET(A1:E10; "Name"; A12:E13)</input> returns an invalid argument error (Err:502). The reflects that multiple records match the specified criterion (both Betty and Charles are age 10).</paragraph>
            </section>

            <section id="Section4">
<bookmark xml-lang="en-US" branch="index" id="bm_id3149766">
<bookmark_value>DMAX function</bookmark_value>
<bookmark_value>maximum values in Calc databases</bookmark_value>
<bookmark_value>searching;maximum values in columns</bookmark_value>
</bookmark><comment>mw added "maximum..." and "searching;"</comment>
<bookmark xml-lang="en-US" branch="hid/SC_HID_FUNC_DBMAX" id="bm_id3158401" localize="false"/>
                <h2 id="hd_id3149766">DMAX</h2>
                <paragraph xml-lang="en-US" id="par_id3154903" role="paragraph"><ahelp hid="HID_FUNC_DBMAX">DMAX calculates the maximum value across the cells (fields) of the specified column that contain numeric values, for all rows (database records) that match the specified search criteria.</ahelp> Blank cells or cells containing non-numeric characters are not included.</paragraph>
                <paragraph role="paragraph" id="par_id51616180409281">Returns 0 if no matches are found, or if there are no non-zero numeric values in the cells of the specified column for the matching records.</paragraph>

                <embed href="text/scalc/01/common_func.xhp#sectionsyntax"/>
                <paragraph xml-lang="en-US" id="par_id3159157" role="code">DMAX(Database; DatabaseField; SearchCriteria)</paragraph>

                <embed href="text/scalc/01/common_func.xhp#sectionexample"/>
                <paragraph xml-lang="en-US" id="par_id3148442" role="paragraph">The example database table giving information about the guests invited to Joe’s birthday party (described above) should occupy cells A1:E10. The content of cells A12:E12 should be identical to the header labels for the database table in cells A1:E1. Make sure that cells A13:E13 are blank, except for cell D13 which should contain ">0" (this search criterion is intended to match all records in the database table).</paragraph>
                <paragraph xml-lang="en-US" id="par_id3148804" role="paragraph">Insert the formula <input>=DMAX(A1:E10; "Distance"; A12:E13)</input> into an empty cell elsewhere in the sheet to find the maximum distance in meters that any of Joe’s party guests travel to school. The value 1200 is returned.</paragraph>
            </section>

            <section id="Section5">
<bookmark xml-lang="en-US" branch="index" id="bm_id3159141">
<bookmark_value>DMIN function</bookmark_value>
<bookmark_value>minimum values in Calc databases</bookmark_value>
<bookmark_value>searching;minimum values in columns</bookmark_value>
</bookmark><comment>mw added "minimum..." and "searching;"</comment>
<bookmark xml-lang="en-US" branch="hid/SC_HID_FUNC_DBMIN" id="bm_id3159152" localize="false"/>
                <h2 id="hd_id3159141">DMIN</h2>
                <paragraph xml-lang="en-US" id="par_id3154261" role="paragraph"><ahelp hid="HID_FUNC_DBMIN">DMIN calculates the minimum value across the cells (fields) of the specified column that contain numeric values, for all rows (database records) that match the specified search criteria.</ahelp> Blank cells or cells containing non-numeric characters are not included.</paragraph>
                <paragraph role="paragraph" id="par_id901616180605426">Returns 0 if no matches are found, or if there are no non-zero numeric values in the cells of the specified column for the matching records.</paragraph>

                <embed href="text/scalc/01/common_func.xhp#sectionsyntax"/>
                <paragraph xml-lang="en-US" id="par_id3148479" role="code">DMIN(Database; DatabaseField; SearchCriteria)</paragraph>

                <embed href="text/scalc/01/common_func.xhp#sectionexample"/>
                <paragraph xml-lang="en-US" id="par_id3148925" role="paragraph">The example database table giving information about the guests invited to Joe’s birthday party (described above) should occupy cells A1:E10. The content of cells A12:E12 should be identical to the header labels for the database table in cells A1:E1. Make sure that cells A13:E13 are blank, except for cell D13 which should contain ">0" (this search criterion is intended to match all records in the database table).</paragraph>
                <paragraph xml-lang="en-US" id="par_id3149161" role="paragraph">Insert the formula <input>=DMIN(A1:E10; "Distance"; A12:E13)</input> into an empty cell elsewhere in the sheet to find the minimum distance in meters that any of Joe’s party guests travel to school. The value 150 is returned.</paragraph>
            </section>

            <section id="Section6">
<bookmark xml-lang="en-US" branch="index" id="bm_id3154274">
<bookmark_value>DAVERAGE function</bookmark_value>
<bookmark_value>averages; in Calc databases</bookmark_value>
<bookmark_value>calculating;averages in Calc databases</bookmark_value>
</bookmark><comment>mw added "averages;..." and "calculating;"</comment>
<bookmark xml-lang="en-US" branch="hid/SC_HID_FUNC_DBMITTELWERT" id="bm_id3166435" localize="false"/>
                <h2 id="hd_id3154274">DAVERAGE</h2>
                <paragraph xml-lang="en-US" id="par_id3166453" role="paragraph"><ahelp hid="HID_FUNC_DBMITTELWERT">DAVERAGE calculates the average of the numeric values in the cells (fields) of the specified column, for all rows (database records) that match the specified search criteria.</ahelp>  Non-numeric values in those cells are ignored.</paragraph>
                <paragraph role="paragraph" id="par_id31615978739452">Returns a #DIV/0! error if no records match the specified search criteria, or if there are no numeric values in the cells of the specified column for the matching records.</paragraph>

                <embed href="text/scalc/01/common_func.xhp#sectionsyntax"/>
                <paragraph xml-lang="en-US" id="par_id3150710" role="code">DAVERAGE(Database; DatabaseField; SearchCriteria)</paragraph>

                <embed href="text/scalc/01/common_func.xhp#sectionexample"/>
                <paragraph xml-lang="en-US" id="par_id3149104" role="paragraph">The example database table giving information about the guests invited to Joe’s birthday party (described above) should occupy cells A1:E10. The content of cells A12:E12 should be identical to the header labels for the database table in cells A1:E1. Make sure that cells A13:E13 are blank, except for cell D13 which should contain ">0" (this search criterion is intended to match all records in the database table).</paragraph>
                <paragraph role="paragraph" id="par_id201616368312277">Insert the formula <input>=DAVERAGE(A1:E10; "Distance"; A12:E13)</input> into an empty cell elsewhere in the sheet to calculate the average distance in meters travelled to school by Joe’s party guests. The value 666.67 is returned.</paragraph>
            </section>

            <section id="Section7">
<bookmark xml-lang="en-US" branch="index" id="bm_id3159269">
<bookmark_value>DPRODUCT function</bookmark_value>
<bookmark_value>multiplying;cell contents in Calc databases</bookmark_value>
</bookmark><comment>mw added "multiplying..."</comment>
<bookmark xml-lang="en-US" branch="hid/SC_HID_FUNC_DBPRODUKT" id="bm_id3159281" localize="false"/>
                <h2 id="hd_id3159269">DPRODUCT</h2>
                <paragraph xml-lang="en-US" id="par_id3152879" role="paragraph"><ahelp hid="HID_FUNC_DBPRODUKT">DPRODUCT calculates the product of all numeric values in the cells (fields) of the specified column, for all rows (database records) that match the specified search criteria.</ahelp> Blank cells or cells containing non-numeric characters are not included.</paragraph>
                <paragraph role="paragraph" id="par_id741616180868336">Returns 0 if no matches are found, or if there are no numeric values in the cells of the specified column for the matching records.</paragraph>

                <embed href="text/scalc/01/common_func.xhp#sectionsyntax"/>
                <paragraph xml-lang="en-US" id="par_id3154854" role="code">DPRODUCT(Database; DatabaseField; SearchCriteria)</paragraph>

                <embed href="text/scalc/01/common_func.xhp#sectionexample"/>
                <paragraph xml-lang="en-US" id="par_id3148986" role="paragraph">The example database table giving information about the guests invited to Joe’s birthday party (described above) should occupy cells A1:E10. The content of cells A12:E12 should be identical to the header labels for the database table in cells A1:E1. Make sure that cells A13:E13 are blank, except for cell C13 which should contain ">0" (this search criterion is intended to match all records in the database table).</paragraph>
                <paragraph role="paragraph" id="par_id91616368981807">Insert the formula <input>=DPRODUCT(A1:E10; "Age"; A12:E13)</input> into an empty cell elsewhere in the sheet to calculate the product of the ages in years of Joe’s party guests. The value 279417600 is returned.</paragraph>
            </section>

            <section id="Section8">
<bookmark xml-lang="en-US" branch="index" id="bm_id3148462">
<bookmark_value>DSTDEV function</bookmark_value>
<bookmark_value>standard deviations in databases;based on a sample</bookmark_value>
</bookmark><comment>mw added "standard deviations...;"</comment>
<bookmark xml-lang="en-US" branch="hid/SC_HID_FUNC_DBSTDABW" id="bm_id3145370" localize="false"/>
                <h2 id="hd_id3148462">DSTDEV</h2>
                <paragraph xml-lang="en-US" id="par_id3154605" role="paragraph"><ahelp hid="HID_FUNC_DBSTDABW">DSTDEV calculates the sample standard deviation based on the numeric values in the cells (fields) of the specified column, for all rows (database records) that match the specified search criteria.</ahelp> Non-numeric values are ignored.</paragraph>
                <paragraph role="paragraph" id="par_id121616181037440">Returns a #NUM! error if exactly one record matches the specified search criteria, or if there is only one numeric value in the cells of the specified column for the matching records.</paragraph>
                <paragraph role="paragraph" id="par_id931616181041535">Returns 0 if no matches are found, or if there are no numeric values in the cells of the specified column for the matching records.</paragraph>

                <embed href="text/scalc/01/common_func.xhp#sectionsyntax"/>
                <paragraph xml-lang="en-US" id="par_id3148661" role="code">DSTDEV(Database; DatabaseField; SearchCriteria)</paragraph>

                <embed href="text/scalc/01/common_func.xhp#sectionexample"/>
                <paragraph xml-lang="en-US" id="par_id3149934" role="paragraph">The example database table giving information about the guests invited to Joe’s birthday party (described above) should occupy cells A1:E10. The content of cells A12:E12 should be identical to the header labels for the database table in cells A1:E1. Make sure that cells A13:D13 are blank and that cell E13 contains ">0" (this search criterion is intended to match all records in the database table).</paragraph>
                <paragraph xml-lang="en-US" id="par_id3150630" role="paragraph">Insert the formula <input>=DSTDEV(A1:E10; "Weight"; A12:E13)</input> into an empty cell elsewhere in the sheet to calculate the sample standard deviation of the weights in kg of Joe’s party guests. The value 5.5 is returned.</paragraph>
            </section>

            <section id="Section9">
<bookmark xml-lang="en-US" branch="index" id="bm_id3150429">
<bookmark_value>DSTDEVP function</bookmark_value>
<bookmark_value>standard deviations in databases;based on populations</bookmark_value>
</bookmark><comment>mw added "standard deviations...;"</comment>
<bookmark xml-lang="en-US" branch="hid/SC_HID_FUNC_DBSTDABWN" id="bm_id3149523" localize="false"/>
                <h2 id="hd_id3150429">DSTDEVP</h2>
                <paragraph xml-lang="en-US" id="par_id3145598" role="paragraph"><ahelp hid="HID_FUNC_DBSTDABWN">DSTDEVP calculates the population standard deviation based on the numeric values in the cells (fields) of the specified column, for all rows (database records) that match the specified search criteria.</ahelp> Non-numeric values are ignored.</paragraph>
                <paragraph role="paragraph" id="par_id541616181205698">Returns a #NUM! error if no records match the specified search criteria, or if there are no numeric values in the cells of the specified column for the matching records.</paragraph>

                <embed href="text/scalc/01/common_func.xhp#sectionsyntax"/>
                <paragraph xml-lang="en-US" id="par_id3149484" role="code">DSTDEVP(Database; DatabaseField; SearchCriteria)</paragraph>

                <embed href="text/scalc/01/common_func.xhp#sectionexample"/>
                <paragraph xml-lang="en-US" id="par_id3155431" role="paragraph">The example database table giving information about the guests invited to Joe’s birthday party (described above) should occupy cells A1:E10. The content of cells A12:E12 should be identical to the header labels for the database table in cells A1:E1. Make sure that cells A13:D13 are blank and that cell E13 contains ">0" (this search criterion is intended to match all records in the database table).</paragraph>
                <paragraph xml-lang="en-US" id="par_id3148411" role="paragraph">Insert the formula <input>=DSTDEVP(A1:E10; "Weight"; A12:E13)</input> into an empty cell elsewhere in the sheet to calculate the population standard deviation of the weights in kg of Joe’s party guests. The value 5.18545 is returned.</paragraph>
            </section>

            <section id="Section10">
<bookmark xml-lang="en-US" branch="index" id="bm_id3154794">
<bookmark_value>DSUM function</bookmark_value>
<bookmark_value>calculating;sums in Calc databases</bookmark_value>
<bookmark_value>sums;cells in Calc databases</bookmark_value>
</bookmark><comment>mw added "calculating;" and "sums;"</comment>
<bookmark xml-lang="en-US" branch="hid/SC_HID_FUNC_DBSUMME" id="bm_id3148687" localize="false"/>
                <h2 id="hd_id3154794">DSUM</h2>
                <paragraph xml-lang="en-US" id="par_id3149591" role="paragraph"><ahelp hid="HID_FUNC_DBSUMME">DSUM calculates the sum of all numeric values in the cells (fields) of the specified column, for all rows (database records) that match the specified search criteria.</ahelp> Blank cells or cells containing non-numeric characters are not included.</paragraph>
                <paragraph role="paragraph" id="par_id691616181332088">Returns 0 if no matches are found, or if there are no numeric values in the cells of the specified column for the matching records.</paragraph>

                <embed href="text/scalc/01/common_func.xhp#sectionsyntax"/>
                <paragraph xml-lang="en-US" id="par_id3150989" role="code">DSUM(Database; DatabaseField; SearchCriteria)</paragraph>

                <embed href="text/scalc/01/common_func.xhp#sectionexample"/>
                <paragraph xml-lang="en-US" id="par_id3152766" role="paragraph">The example database table giving information about the guests invited to Joe’s birthday party (described above) should occupy cells A1:E10. The content of cells A12:E12 should be identical to the header labels for the database table in cells A1:E1. Make sure that cells A13:E13 are blank, except for cell D13 which should contain ">0" (this search criterion is intended to match all records in the database table).</paragraph>
                <paragraph xml-lang="en-US" id="par_id3151312" role="paragraph">Insert the formula <input>=DSUM(A1:E10; "Distance"; A12:E13)</input> into an empty cell elsewhere in the sheet to find the total distance in meters that all of Joe’s party guests travel to school. The value 6000 is returned.</paragraph>
            </section>

            <section id="Section11">
<bookmark xml-lang="en-US" branch="index" id="bm_id3155614">
<bookmark_value>DVAR function</bookmark_value>
<bookmark_value>variances;based on samples</bookmark_value>
</bookmark><comment>mw added "variances;"</comment>
<bookmark xml-lang="en-US" branch="hid/SC_HID_FUNC_DBVARIANZ" id="bm_id3159391" localize="false"/>
                <h2 id="hd_id3155614">DVAR</h2>
                <paragraph xml-lang="en-US" id="par_id3154418" role="paragraph"><ahelp hid="HID_FUNC_DBVARIANZ">DVAR calculates the sample variance based on the numeric values in the cells (fields) of the specified column, for all rows (database records) that match the specified search criteria.</ahelp> Non-numeric values are ignored.</paragraph>
                <paragraph role="paragraph" id="par_id301616181465164">Returns a #NUM! error if exactly one record matches the specified search criteria, or if there is only one numeric value in the cells of the specified column for the matching records.</paragraph>
                <paragraph role="paragraph" id="par_id741616181469136">Returns 0 if no matches are found, or if there are no numeric values in the cells of the specified column for the matching records.</paragraph>

                <embed href="text/scalc/01/common_func.xhp#sectionsyntax"/>
                <paragraph xml-lang="en-US" id="par_id3156138" role="code">DVAR(Database; DatabaseField; SearchCriteria)</paragraph>

                <embed href="text/scalc/01/common_func.xhp#sectionexample"/>
                <paragraph xml-lang="en-US" id="par_id3153701" role="paragraph">The example database table giving information about the guests invited to Joe’s birthday party (described above) should occupy cells A1:E10. The content of cells A12:E12 should be identical to the header labels for the database table in cells A1:E1. Make sure that cells A13:E13 are blank, except for cell D13 which should contain ">0" (this search criterion is intended to match all records in the database table).</paragraph>
                <paragraph xml-lang="en-US" id="par_id3153676" role="paragraph">Insert the formula <input>=DVAR(A1:E10; "Distance"; A12:E13)</input> into an empty cell elsewhere in the sheet to find the sample variance of the distances in meters that Joe’s party guests travel to school. The value 193125 is returned.</paragraph>
            </section>

            <section id="Section12">
<bookmark xml-lang="en-US" branch="index" id="bm_id3153880">
<bookmark_value>DVARP function</bookmark_value>
<bookmark_value>variances;based on populations</bookmark_value>
</bookmark><comment>mw added "variances;"</comment>
<bookmark xml-lang="en-US" branch="hid/SC_HID_FUNC_DBVARIANZEN" id="bm_id3153891" localize="false"/>
                <h2 id="hd_id3153880">DVARP</h2>
                <paragraph xml-lang="en-US" id="par_id3155119" role="paragraph"><ahelp hid="HID_FUNC_DBVARIANZEN">DVARP calculates the population variation based on the numeric values in the cells (fields) of the specified column, for all rows (database records) that match the specified search criteria.</ahelp> Non-numeric values are ignored.</paragraph>
                <paragraph role="paragraph" id="par_id301616181648263">Returns a #NUM! error if no records match the specified search criteria, or if there are no numeric values in the cells of the specified column for the matching records.</paragraph>

                <embed href="text/scalc/01/common_func.xhp#sectionsyntax"/>
                <paragraph xml-lang="en-US" id="par_id3153776" role="code">DVARP(Database; DatabaseField; SearchCriteria)</paragraph>

                <embed href="text/scalc/01/common_func.xhp#sectionexample"/>
                <paragraph xml-lang="en-US" id="par_id3147099" role="paragraph">The example database table giving information about the guests invited to Joe’s birthday party (described above) should occupy cells A1:E10. The content of cells A12:E12 should be identical to the header labels for the database table in cells A1:E1. Make sure that cells A13:E13 are blank, except for cell D13 which should contain ">0" (this search criterion is intended to match all records in the database table).</paragraph>
                <paragraph xml-lang="en-US" id="par_id3147322" role="paragraph">Insert the formula <input>=DVARP(A1:E10; "Distance"; A12:E13)</input> into an empty cell elsewhere in the sheet to find the population variance of the distances in meters that Joe’s party guests travel to school. The value 171666.67 is returned.</paragraph>
            </section>
        </sort>

        <section id="relatedtopics">
            <embed href="text/scalc/01/04060100.xhp#drking"/>
        </section>
    </body>
</helpdocument>