<?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/.
 *
-->

<meta>
  <topic id="textscalc01func_averageifxml">
    <title id="tit" xml-lang="en-US">Examples Dataset for Statistical Functions</title>
    <filename>/text/scalc/01/ex_data_stat_func.xhp</filename>
  </topic>
</meta>

<body>
<section id="ex_func_average">
<embed href="text/scalc/01/common_func.xhp#sectionexample"/>
<paragraph id="hd_id2609201512474295" role="heading" level="4" xml-lang="en-US">Consider the following table</paragraph>
<table id="table_averageif_example">
  <tablerow>
    <tablecell>
    </tablecell>
    <tablecell>
      <paragraph id="par_id2509201517430799" role="tablehead" localize="false" xml-lang="en-US">A</paragraph>
    </tablecell>
    <tablecell>
      <paragraph id="par_id250920151743116" role="tablehead" localize="false" xml-lang="en-US">B</paragraph>
    </tablecell>
    <tablecell>
      <paragraph id="par_id2509201517431582" role="tablehead" localize="false" xml-lang="en-US">C</paragraph>
    </tablecell>
  </tablerow>
  <tablerow>
    <tablecell>
      <paragraph id="par_id2509201517431967" role="tablehead" localize="false" xml-lang="en-US">1</paragraph>
    </tablecell>
    <tablecell>
      <paragraph id="par_id18260631312423" role="tablecontent" xml-lang="en-US">Product Name</paragraph>
    </tablecell>
    <tablecell>
      <paragraph id="par_id2509201517433075" role="tablecontent" xml-lang="en-US">Sales</paragraph>
    </tablecell>
    <tablecell>
      <paragraph id="par_id2509201519383294" role="tablecontent" xml-lang="en-US">Revenue</paragraph>
    </tablecell>
  </tablerow>
  <tablerow>
    <tablecell>
      <paragraph id="par_id959660094035" role="tablehead" localize="false" xml-lang="en-US">2</paragraph>
    </tablecell>
    <tablecell>
      <paragraph id="par_id2855779586764" role="tablecontent" xml-lang="en-US">pencil</paragraph>
    </tablecell>
    <tablecell>
      <paragraph id="par_id110202156219769" role="tablecontent" localize="false" xml-lang="en-US">20</paragraph>
    </tablecell>
    <tablecell>
      <paragraph id="par_id23281929326512" role="tablecontent" localize="false" xml-lang="en-US">65</paragraph>
    </tablecell>
  </tablerow>
  <tablerow>
    <tablecell>
      <paragraph id="par_id2509201517432278" role="tablehead" localize="false" xml-lang="en-US">3</paragraph>
    </tablecell>
    <tablecell>
      <paragraph id="par_id24967262611733" role="tablecontent" xml-lang="en-US">pen</paragraph>
    </tablecell>
    <tablecell>
      <paragraph id="par_id2509201517433391" role="tablecontent" localize="false" xml-lang="en-US">35</paragraph>
    </tablecell>
    <tablecell>
      <paragraph id="par_id250920151938352" role="tablecontent" localize="false" xml-lang="en-US">85</paragraph>
    </tablecell>
  </tablerow>
  <tablerow>
    <tablecell>
      <paragraph id="par_id250920151743267" role="tablehead" localize="false" xml-lang="en-US">4</paragraph>
    </tablecell>
    <tablecell>
      <paragraph id="par_id252542413030532" role="tablecontent" xml-lang="en-US">notebook</paragraph>
    </tablecell>
    <tablecell>
      <paragraph id="par_id2509201517433781" role="tablecontent" localize="false" xml-lang="en-US">20</paragraph>
    </tablecell>
    <tablecell>
      <paragraph id="par_id2509201519383822" role="tablecontent" localize="false" xml-lang="en-US">190</paragraph>
    </tablecell>
  </tablerow>
  <tablerow>
    <tablecell>
      <paragraph id="par_id2509201519371339" role="tablehead" localize="false" xml-lang="en-US">5</paragraph>
    </tablecell>
    <tablecell>
      <paragraph id="par_id2509201519374677" role="tablecontent" xml-lang="en-US">book</paragraph>
    </tablecell>
    <tablecell>
      <paragraph id="par_id2509201519373350" role="tablecontent" localize="false" xml-lang="en-US">17</paragraph>
    </tablecell>
    <tablecell>
      <paragraph id="par_id2509201519384171" role="tablecontent" localize="false" xml-lang="en-US">180</paragraph>
    </tablecell>
  </tablerow>
    <tablerow>
    <tablecell>
      <paragraph id="par_id6009596127912" role="tablehead" localize="false" xml-lang="en-US">6</paragraph>
    </tablecell>
    <tablecell>
      <paragraph id="par_id19479417931163" role="tablecontent" xml-lang="en-US">pencil-case</paragraph>
    </tablecell>
    <tablecell>
      <paragraph id="par_id85353130721737" role="tablecontent" xml-lang="en-US">not</paragraph>
    </tablecell>
    <tablecell>
      <paragraph id="par_id15693941827291" role="tablecontent" xml-lang="en-US">not</paragraph>
    </tablecell>
  </tablerow>
</table>
<paragraph id="par_id1191767622119" role="warning" xml-lang="en-US">In all examples below, ranges for calculation contain the row #6, which is ignored because it contains text.</paragraph>
</section>
<paragraph role="paragraph" id="par_id961527953004850" xml-lang="en-US"><variable id="args">Func_Range; Range1; Criterion1 [ ; Range2; Criterion2 [;...]])</variable></paragraph>
<section id="note01">
    <paragraph id="par_id94162948227556" role="note" xml-lang="en-US">The logical relation between criteria can be defined as logical AND (conjunction). In other words, if and only if all given criteria are met, a value from the corresponding cell of the given <emph>Func_Range</emph> is taken into calculation.</paragraph>
</section>
<section id="warning01">
    <paragraph id="par_id14734320631377" role="warning" xml-lang="en-US"><emph>Func_Range</emph> and <emph>Range1, Range2...</emph> must have the same size, otherwise the function returns err:502 - Invalid argument.</paragraph>
</section>
<section id="par00">
    <paragraph id="par_id23526994221948" role="paragraph" xml-lang="en-US"><emph>Criterion1</emph> – required argument. A string expression representing a logical condition or a cell reference to such string expression. The expression can contain text, numbers, regular expressions or wildcards (<link href="text/shared/optionen/01060500.xhp#wildcards" name="Wild cards">if enabled in calculation options</link>).</paragraph>
    <paragraph id="par_id190621657742" role="paragraph" xml-lang="en-US"><emph>Range2</emph> – Optional. Range2 and all the following mean the same as Range1.</paragraph>
    <paragraph id="par_id317001803813193" role="paragraph" xml-lang="en-US"><emph>Criterion2</emph> – Optional. Criterion2 and all the following mean the same as Criterion1.</paragraph>
</section>
<section id="par01">
    <paragraph xml-lang="en-US" id="par_id191527781733238" role="paragraph">The function can have up to 255 arguments, meaning that you can specify 127 criteria ranges and criteria for them.</paragraph>
    <paragraph id="par_id175721789527973" role="warning" xml-lang="en-US">If a cell contains TRUE, it is treated as 1, if a cell contains FALSE – as 0 (zero).</paragraph>
</section>
</body>
</helpdocument>
