MindFusion.Wpf Pack Programmer's Guide
DAVERAGE

Returns the average of the values in the specified column of the specified database that match the specified criteria.

Syntax  Copy Code

DAVERAGE( Database database, TextOrNumber field, Reference criteria ) Number

Parameters

database
Required. A range of cells that makes up the database. The first row of the database contains labels for each column.
field
Required. A number or text indicating which column is used in the function.
criteria
Required. A range of cells that contains the conditions.

Remarks

You can use any range for the criteria argument, as long as it includes at least one column label and at least one cell underneath the column label for specifying the condition.

Example

The following table shows a small database for a grocery shop. Each record in the table contains information about one item. Above the database are several cells that contain the conditions used as the function criteria.

NAME

CATEGORY

PRICE

PRICE

 

Beverages

>10

<15

 

 

Confections

 

 

 

Name

Category

Weight

Qty

Price

Blueberry Tea

Beverages

400

12

12.50

Ipoh Cofee

Beverages

500

20

18.00

Chocolade

Confections

1250

10

22.45

Steeleye Stout

Beverages

750

6

7.95

Scottish Longbreads

Confections

450

8

11.50

Mascarpone

Dairy

250

2

7.50

The formula to evaluate the average quantity of beverages with price over 10 is given below:

Formula  Copy Code

=DAVERAGE(A4:E10,"Qty",B1:C2)

See Also

Function Reference
DGET Function
DCOUNT Function
DCOUNTA Function
DMAX Function
DMIN Function
DPRODUCT Function
DSTDEV Function
DSTDEVP Function
DSUM Function
DVAR Function
DVARP Function