Difference between revisions of "Manuals/calci/DAVERAGE"

From ZCubes Wiki
Jump to navigation Jump to search
(Created page with "<div id="6SpaceContent" class="zcontent" align="left">  DAVERAGE(db,fld,cri) <br /> where db is the range of cells that makes up the list or database, fld indicat...")
 
 
(30 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<div id="6SpaceContent" class="zcontent" align="left"> 
+
<div style="font-size:30px">'''DAVERAGE (Array,Field,Criteria)'''</div><br/>
 +
*Where 'Array' is the range of cells that makes up the list or database
 +
*'Field' shows which column is used in the function and
 +
*'Criteria' is the range of cells that contains the specified criteria.
 +
**DAVERAGE(), returns the average of selected database entries.
  
DAVERAGE(db,fld,cri)
+
== Description ==
  
<br />
+
DAVERAGE (Array,Field,Criteria)
  
where db is the range of cells that makes up the list or database,
+
It averages the values in a column of a list or database that match the specified condition.
  
fld indicates which column is used in the function and
+
* A 'Field' argument can be expressed as "Price" (a column name) or 3 (position of column number).
  
cri is the range of cells that contains the conditions we specify.
+
*Criteria can be any range on the 'Calci' with minimum of one column and at least one row indicating the condition.
  
<br />
+
*The Criteria columns should not overlap the list of data.
  
</div>
+
*DCOUNT() can be used to count the cells having numbers from a list or database that match a specified criteria.
----
 
<div id="1SpaceContent" class="zcontent" align="left"> It averages the values in a column of a list or database that match conditions we specify.</div>
 
----
 
<div id="12SpaceContent" class="zcontent" align="left"><div class="ZEditBox" align="left">
 
  
DAVERAGE
+
*DCOUNTA() can be used to count the number of non-blank cells from a list of database that match a specified criteria.
  
</div></div>
+
== Examples ==
----
 
<div id="8SpaceContent" class="zcontent" align="left"> 
 
  
<u>[javascript:ToggleDiv('divExpCollAsst_4') <font color="#0000ff">Let's see an example</font>]</u>
+
Consider the following table using ZCalci with Stationary Items, Quantity, Price and Percentage Profit.
  
<font color="#0000ff"><br /></font>
+
<div id="4SpaceContent" class="zcontent" align="left">
  
[javascript:ToggleDiv('divExpCollAsst_4') <u><font color="#0000ff">C1 C2 C3 C4 </font></u>]
+
{| id="TABLE2" class="SpreadSheet blue"
 +
|- class="even"
 +
| class="sshl_f" |
 +
| class="sshl_f" | A
 +
| class="sshl_f" | B
 +
| class="sshl_f" | C
 +
| class="sshl_f" | D
  
<font color="#0000ff"><br /></font>
+
|- class="odd"
 +
| class="sshl_f" | 1
 +
| class="sshl_f" | '''Item'''
 +
| class="sshl_f" | '''Quantity'''
 +
| class="sshl_f" | '''Price'''
 +
| class="sshl_f" | '''Profit'''
  
[javascript:ToggleDiv('divExpCollAsst_4') <u><font color="#0000ff">R1 Stationary Items Count Price Profit</font></u>]
+
|- class="even"
 +
| class="sshl_f" | 2
 +
| class="sshl_f" | Pen
 +
| class="sshl_f" | &gt;10
 +
| class="sshl_f" |
 +
| class="ssh1_f" |
  
<font color="#0000ff"><br /></font>
+
|- class="odd"
 +
| class="sshl_f" | 3
 +
| class="sshl_f" | '''Item'''
 +
| class="sshl_f" | '''Quantity'''
 +
| class="sshl_f" | '''Price'''
 +
| class="sshl_f" | '''Profit'''
  
<font color="#0000ff"><br /></font>
+
|- class="even"
 +
| class="sshl_f" | 4
 +
| class="sshl_f" | Pen
 +
| class="sshl_f" | 12
 +
| class="sshl_f" | 40
 +
| class="sshl_f" | 2
  
[javascript:ToggleDiv('divExpCollAsst_4') <u><font color="#0000ff">R2 Pen 10 40 10</font></u>]
+
|- class="odd"
 +
| class="sshl_f" | 5
 +
| class="sshl_f" | Pencil
 +
| class="sshl_f" | 20
 +
| class="sshl_f" | 20
 +
| class="sshl_f" | 1
  
<font color="#0000ff"><br /></font>
+
|- class="even"
 +
| class="sshl_f" | 6
 +
| class="sshl_f" | Books
 +
| class="sshl_f" | 25
 +
| class="sshl_f" | 75
 +
| class="ssh1_f" | 5
 +
 
 +
|- class="odd"
 +
| class="sshl_f" | 7
 +
| class="sshl_f" | Pen
 +
| class="sshl_f" | 30
 +
| class="sshl_f" | 93.33
 +
| class="sshl_f" | 4
 +
|}
  
<font color="#0000ff"><br /></font>
 
  
[javascript:ToggleDiv('divExpCollAsst_4') <u><font color="#0000ff">R3 Pencil 20 30 15</font></u>]
+
= DAVERAGE(A3:D7,"Price",A1:B2)  : Calculates the average price of Pens in the range A3 to D7, for the cells with Quantity>10. <br>Returns '''66.66499999999999''' as a result.
  
<font color="#0000ff"><br /></font>
+
= DAVERAGE(A3:D7,2,A1:B2)  : Calculates the average number of Pens in the range A3 to D7, for the cells with Quantity>10. <br>Returns '''21''' as a result.
  
<font color="#0000ff"><br /></font>
+
= DAVERAGE(A3:D7,"Quantity",A3:D7) : Calculates the average number of all items in the range A3 to D7. <br>Returns '''21.75''' as a result.
  
[javascript:ToggleDiv('divExpCollAsst_4') <u><font color="#0000ff">R4 Books 15 75 20</font></u>]
+
= DAVERAGE(A3:D7,4,A3:D7) : Calculates the average of percentage profit of all the items in the range A3 to D7. <br>Returns '''3''' as a result.
  
<font color="#0000ff"><br /></font>
+
== Related Videos ==
 +
{{#ev:youtube|-eYn-c8UIjw|280|center|DAVERAGE}}
  
<font color="#0000ff"><br /></font>
+
== See Also ==
  
<font color="#0000ff"><br /></font>
+
*[[Manuals/calci/DCOUNT| DCOUNT]]
 +
*[[Manuals/calci/DCOUNTA| DCOUNTA]]
  
<font color="#0000ff"><br /></font>
+
==References==
  
<font color="#0000ff"><br /></font>
+
*[http://en.wikipedia.org/wiki/Aggregate_function List of Aggregate Functions]
 +
*[http://en.wikipedia.org/wiki/Aggregate_function DAVERAGE]
  
[javascript:ToggleDiv('divExpCollAsst_4') <u><font color="#0000ff">I.e. =DAVERAGE(C1R1:C4R6,3,C1R1:C4R4) is 48.333(average price of the items)</font></u>]
 
  
</div>
 
----
 
<div id="10SpaceContent" class="zcontent" align="left"><div class="ZEditBox" align="justify">Syntax </div><div class="ZEditBox"><center></center></div></div>
 
----
 
<div id="3SpaceContent" class="zcontent" align="left"><div class="ZEditBox" align="justify">Examples </div></div>
 
----
 
<div id="11SpaceContent" class="zcontent" align="left"><div class="ZEditBox" align="justify">Description </div></div>
 
----
 
<div id="4SpaceContent" class="zcontent" align="left">
 
  
{| id="TABLE2" class="SpreadSheet blue"
+
*[[Z_API_Functions | List of Main Z Functions]]
|- class="even"
 
| class=" " |
 
| Column1
 
| class="  " | Column2
 
| Column3
 
| Column4
 
|- class="odd"
 
| class=" " | Row1
 
| class="sshl_f        " | Stationary Items
 
| class="sshl_f" | Count
 
| class="sshl_f " | Price
 
| class="sshl_f" | Profit
 
|- class="even"
 
| class="  " | Row2
 
| class="sshl_f" | Pen
 
| class="sshl_f  " | 10
 
| class="sshl_f" | 40
 
| class="sshl_f" | 10
 
|- class="odd"
 
| Row3
 
| class="sshl_f" | Pencil
 
| class="sshl_f  " |
 
<div id="4Space_Handle" title="Click and Drag to resize CALCI Column/Row/Cell. It is EZ!"></div><div id="4Space_Copy" title="Click and Drag over to AutoFill other cells."></div>20
 
| class="sshl_f" | 30
 
| class="sshl_f      " | 15
 
|- class="even"
 
| Row4
 
| class="sshl_f" | Books
 
| class="sshl_f" | 15
 
| class="sshl_f " | 75
 
| class=" " | 20
 
|- class="odd"
 
| class=" " | Row5
 
| class="sshl_f    " |
 
| class="sshl_f" | 48.3333
 
| class="                                                                                                                      " |
 
| class=" " |
 
|}
 
  
<div align="left">[[Image:calci1.gif]]</div></div>
+
*[[ Z3 |  Z3 home ]]
----
 

Latest revision as of 13:44, 24 August 2018

DAVERAGE (Array,Field,Criteria)


  • Where 'Array' is the range of cells that makes up the list or database
  • 'Field' shows which column is used in the function and
  • 'Criteria' is the range of cells that contains the specified criteria.
    • DAVERAGE(), returns the average of selected database entries.

Description

DAVERAGE (Array,Field,Criteria)

It averages the values in a column of a list or database that match the specified condition.

  • A 'Field' argument can be expressed as "Price" (a column name) or 3 (position of column number).
  • Criteria can be any range on the 'Calci' with minimum of one column and at least one row indicating the condition.
  • The Criteria columns should not overlap the list of data.
  • DCOUNT() can be used to count the cells having numbers from a list or database that match a specified criteria.
  • DCOUNTA() can be used to count the number of non-blank cells from a list of database that match a specified criteria.

Examples

Consider the following table using ZCalci with Stationary Items, Quantity, Price and Percentage Profit.

A B C D
1 Item Quantity Price Profit
2 Pen >10
3 Item Quantity Price Profit
4 Pen 12 40 2
5 Pencil 20 20 1
6 Books 25 75 5
7 Pen 30 93.33 4


= DAVERAGE(A3:D7,"Price",A1:B2) : Calculates the average price of Pens in the range A3 to D7, for the cells with Quantity>10.
Returns 66.66499999999999 as a result.

= DAVERAGE(A3:D7,2,A1:B2) : Calculates the average number of Pens in the range A3 to D7, for the cells with Quantity>10.
Returns 21 as a result.

= DAVERAGE(A3:D7,"Quantity",A3:D7) : Calculates the average number of all items in the range A3 to D7.
Returns 21.75 as a result.

= DAVERAGE(A3:D7,4,A3:D7) : Calculates the average of percentage profit of all the items in the range A3 to D7.
Returns 3 as a result.

Related Videos

DAVERAGE

See Also

References