## What is DAVERAGE Function in Excel?

The **DAVERAGE** function is one of the **Database** functions of Excel.

It averages the values of a column in a list or database that matches the conditions you specify.

We can find this function in t**he Database** of the insert function Tab.

## How to use **DAVERAGE **function in excel

- Click on an empty cell (like F5 )

2. Click on the **fx **icon (or press** shift+F3**)

3. In** insert function** tab you will see all functions

4. Select **Database** category

5. Select ** DAVERAGE** function

6. Then select **ok**

7. In function arguments Tab you will see **DAVERAGE **function

8. In the **Database section** you can enter the **range of cells** that makes up the list or database. A database is a list of related data (ex:Table1)

9. The **Field section** is either the label of the column in double quotation marks or a number that represents the column’s position in the list (ex:C1)

10. **Criteria section** is the range of cells that contains the **conditions **you specify. The range includes a column label and one cell below the label for a condition (ex:Table1)

11. You will see the **result **in formula result section

## Examples of DAVERAGE function in excel

**Example1:**

### calculate the average of student ages with DAVERAGE function in excel

`DAVERAGE `**(Table1[#All],C1,Table1[#All])**----->>>>answer is 25

**Example 2:**

### calculate the average of student height with DAVERAGE function in excel

`DAVERAGE `**(Table1[#All],C1,Table1[#All])**----->>>>answer is 201.5

**Example 3:**

### Python code for DAVERAGE function

Name | Age | Height | Weight |

Olivia | 25 | 210 | 180 |

Noah | 25 | 205 | 235 |

Oliver | 27 | 195 | 205 |

Elijah | 22 | 198 | 185 |

James | 29 | 199 | 231 |

William | 29 | 201 | 240 |

Benjamin | 21 | 202 | 235 |

Lucas | 25 | 200 | 238 |

Henry | 22 | 204 | 190 |

```
import pandas as pd
df=pd.read_csv(‘example.csv’)
avgdf = df.mean(axis=0, numeric_only= True)
print (avgdf)
```

## Purpose of DAVERAGE function

The DAVERAGE function in Excel is used to calculate the average of values from a database based on specific criteria.

It requires three arguments: the database range, the field or column to be averaged, and the criteria range that specifies the conditions that must be met for a value to be included in the calculation.

For example, if you have a database of sales data with multiple columns such as date, region, product type, and sales amount, you can use the DAVERAGE function to find the average sales amount for a specific region, product type, or date range.

You would specify the database range as the range of cells containing all the data, the field argument as the sales amount column, and the criteria range as a range of cells containing the specific criteria you want to filter on (e.g., region equals “West”).

The DAVERAGE function is useful when dealing with large datasets where it is difficult to manually calculate averages based on specific criteria. It saves time and provides accurate results.

## Errors in DAVERAGE function

If no record matches the criteria, DAVERAGE returns the #DIV/0! error value.

`DAVERAGE (Table13[#All],"Age",A1:A2)=#DIV/0!`

## Conditions and criteria range in DAVERAGE function

### Criteria argument in **DAVERAGE** function

we can define any range for the criteria argument: it has 2 condition

1. It includes at least one column label

2. It includes at least one cell under the column label.

For example, if the range A1:A2 contains “Name” in A1 and “Benjamin” in A2,

you could define A1=”Name” & A2=”Benjamin”

Dget function find the word of “Benjamin” under “name” column

### Location of Criteria range in **DAVERAGE** function

Although the criteria range can be located anywhere on the worksheet, do not place the criteria range below the list.

If you add more information to the list, the new information is added to the first row below the list. If the row below the list is not blank, Microsoft Excel cannot add the new information.

Make sure that the criteria range does not overlap the list.

To perform an operation on an entire column in a database, enter a blank line below the column labels in the criteria range.

## Examples of DAVERAGE function in Excel

- Calculate the average salary of all employees in the “Sales” department:
`=`

**DAVERAGE(A2:C11,"Salary",A2:A11="Sales")** - Calculate the average age of all female employees in the company:
`=`

**DAVERAGE(A2:C11,"Age",C2:C11="Female")** - Calculate the average score of all students who scored above 80% on their final exam:
`=`

**DAVERAGE(A2:D21,"Score",D2:D21>80%)** - Calculate the average price of all products with “Widget” in their name:
`=`

**DAVERAGE(A2:B16,"Price",A2:A16="*Widget*")** - Calculate the average sales for the month of January:
`=`

**DAVERAGE(A2:C31,"Sales",B2:B31>=DATE(2021,1,1),B2:B31<=DATE(2021,1,31))** - Calculate the average temperature for all cities that start with the letter “S”:
`=`

**DAVERAGE(A2:B22,"Temperature",LEFT(A2:A22,1)="S")** - Calculate the average weight of all animals that are mammals:
`=`

**DAVERAGE(A2:C18,"Weight",B2:B18="Mammal")** - Calculate the average height of all basketball players on the team:
`=`

**DAVERAGE(A2:C13,"Height",C2:C13="Basketball")** - Calculate the average number of hours worked by all employees who work in the “Customer Service” department:
`=`

**DAVERAGE(A2:C11,"Hours Worked",A2:A11="Customer Service")** - Calculate the average GPA of all students who are sophomores:
`=`

**DAVERAGE(A2:C25,"GPA",B2:B25="Sophomore")**

## Using the DAVERAGE: calculate average values based on criteria

Suppose you have a table of employee information that includes columns for Name, Department, Salary, and Age.

You want to calculate the average salary of employees in the Sales department who are over the age of 30.

Here’s what the criteria range might look like, assuming your data starts in cell A2:

A | B | C | |
---|---|---|---|

1 | Department | Age | |

2 | Sales | >30 |

To calculate the average salary based on these criteria, you would use the following formula:

`=`

**DAVERAGE(A2:D11,"Salary",A1:B2)**

This tells Excel to look at the range of cells A2:D11 as the database, average the values in the “Salary” column (which is the third column), and only include rows that meet the criteria specified in the range A1:B2.

**Another example:**

Suppose you have a table of student information that includes columns for Name, Gender, Age, and Grade. You want to calculate the average grade of female students who are under the age of 25.

Here’s what the criteria range might look like, assuming your data starts in cell A2:

A | B | |
---|---|---|

1 | Gender | Age |

2 | Female | <25 |

To calculate the average grade based on these criteria, you would use the following formula:

**=DAVERAGE(A2:D21,"Grade",A1:B2)**

This tells Excel to look at the range of cells A2:D21 as the database, average the values in the “Grade” column (which is the fourth column), and only include rows that meet the criteria specified in the range A1:B2.

Overall, the DAVERAGE function can be a powerful tool for analyzing subsets of data based on specific criteria, and can save you time when working with large sets of data in Excel.

## DAVERAGE function with a range of cells that contain text

The DAVERAGE function in Excel is typically used to calculate the average of a range of numeric values based on specific criteria.

Therefore, it cannot be used with a range of cells that contain text.

If you try to use the DAVERAGE function with a range of cells that contain text, Excel will return a #NUM! error.

However, there are several other functions in Excel that can be used to analyze and manipulate text data, such as the CONCATENATE , LEFT , RIGHT function, and others.

For example, suppose you have a table of customer information that includes columns for Name, Email Address, and Sales Total.

You want to calculate the average sales total for customers whose email address ends in “@gmail.com”.

Here’s what the criteria range might look like, assuming your data starts in cell A2:

A | B | |
---|---|---|

1 | Email Address | |

2 | *gmail.com |

To filter the data based on this criteria, you would need to use a different function, such as the AVERAGEIF or AVERAGEIFS function.

For example, you could use the following formula to calculate the average sales total for customers whose email address ends in “@gmail.com”:

**=AVERAGEIF(B2:B11,"*gmail.com",C2:C11)**

This tells Excel to look at the range of cells B2:B11 to find any cells that end with “@gmail.com”, and then average the values in column C (which contains the sales totals) for any matching rows.

So while the DAVERAGE function cannot be used with a range of cells that contain text, there are other functions in Excel that can be used to manipulate and analyze text data in more sophisticated ways.

## limitations of using the DAVERAGE function

While the DAVERAGE function in Excel can be a powerful tool for analyzing subsets of data based on specific criteria, there are some limitations to keep in mind when using this function.

**Here are a few examples:**

**The criteria range must include column headers**: When using the DAVERAGE function, the criteria range must include a row with column headers that match the names of the fields or columns you want to filter by. If your criteria range does not include these headers, the function will return a #VALUE! error.**The database range must include all columns of your data**: The database range you specify when using the DAVERAGE function must include all columns of your data, including any headers. If you leave out a column, or if there are gaps between columns in your range, the function will return a #VALUE! error.**The criteria range cannot contain blank cells**: When specifying criteria for the DAVERAGE function, you cannot leave any cells blank in the criteria range. If you do, the function will return a #DIV/0! error.**The criteria range cannot include more than one row**: The criteria range for the DAVERAGE function must include only one row of criteria. If you try to include more than one row, the function will return a #NUM! error.**The DAVERAGE function is case sensitive**: When specifying criteria for the DAVERAGE function, it is important to remember that the function is case-sensitive. This means that “Sales” and “sales” would be treated as different criteria, even if they refer to the same value.**The DAVERAGE function only works with simple comparisons**: When specifying criteria for the DAVERAGE function, you can only use simple comparisons like “equals”, “greater than”, or “less than”. You cannot use more complex logical operators like “AND” or “OR”. To use multiple criteria in the DAVERAGE function, you will need to use a combination of other functions like the SUMPRODUCT function or helper columns.**The DAVERAGE function cannot handle errors**: If any cells in your database range contain errors (such as #N/A or #DIV/0!), the DAVERAGE function will return a #VALUE! error.

## Citeria for the DAVERAGE function in Excel?

To use the DAVERAGE function in Excel to calculate average values based on certain criteria, you need to specify the criteria range.

The criteria range is a range of cells that specifies the conditions that must be met in order for a particular cell or group of cells to be included in the calculation.

**Here are the steps you can follow to specify the criteria for the DAVERAGE function:**

**Create a criteria range**: Start by creating a separate criteria range that specifies the conditions you want to use to filter your data. This range should include one row with column headers and another row with the criteria you want to use for filtering the data.**Define the range and field arguments**: Next, you need to define the range and field arguments in the DAVERAGE function. The range argument should be the range of cells that contains your data, including any headers. The field argument should be the column or field you want to average.**Specify the criteria range**: Finally, you need to specify the criteria range as the third argument in the DAVERAGE function. This range should include the column headers and the criteria you want to use for filtering the data.

**Here’s an example to illustrate how to specify the criteria for the DAVERAGE function:**

Suppose you have a table of employee information that includes columns for Name, Department, Salary, and Age.

You want to calculate the average salary of employees in the Sales department who are over the age of 30.

Here’s what the criteria range might look like, assuming your data starts in cell A2:

A | B | |
---|---|---|

1 | Department | Age |

2 | Sales | >30 |

To specify these criteria in the DAVERAGE function, you would use the following formula:

**=DAVERAGE(A2:D11,"Salary",A1:B2)**

This tells Excel to look at the range of cells A2:D11 as the database, average the values in the “Salary” column (which is the third column), and only include rows that meet the criteria specified in the range A1:B2.

You can use similar steps to specify different types of criteria for the DAVERAGE function, depending on the data you’re working with and the information you want to analyze.

Just be sure to follow the guidelines for creating a criteria range and defining the range and field arguments correctly in order to get accurate results.

## Criteria for the DAVERAGE function be based on multiple criteria

Yes, the criteria for the DAVERAGE function in Excel can be based on multiple criteria. This allows you to filter your data more precisely and calculate average values based on complex conditions.

To use multiple criteria with the DAVERAGE function, you can use the ampersand symbol (&) to join two or more criteria together in the same cell.

You can also use separate cells for each criterion and reference those cells in your formula using logical operators like AND or OR.

Here’s an example to illustrate how to use multiple criteria with the DAVERAGE function:

Suppose you have a table of sales information that includes columns for Salesperson Name, Region, Product Type, and Sales Amount.

You want to calculate the average sales amount for salespeople who work in the East region and sold either Widgets or Gadgets.

Here’s what the criteria range might look like, assuming your data starts in cell A2:

A | B | C | |
---|---|---|---|

1 | Region | Product | |

2 | East | Widget | |

3 | East | Gadget |

To specify these criteria in the DAVERAGE function, you would use the following formula:

**=DAVERAGE(A2:D11,"Sales Amount",A1:C3)**

This tells Excel to look at the range of cells A2:D11 as the database, average the values in the “Sales Amount” column (which is the fourth column), and only include rows that meet the criteria specified in the range A1:C3.

In this case, the range specifies that the Region must be “East” and the Product Type must be either “Widget” or “Gadget”.

Note that when using multiple criteria with the DAVERAGE function, you need to make sure you are combining the criteria correctly and using logical operators where necessary to get accurate results.

You should also be careful to include all the necessary columns in your database range to avoid errors in your calculation.

## Troubleshoot issues with the DAVERAGE function not returning expected results

If you’re having issues with the DAVERAGE function in Excel not returning expected results, there are a few troubleshooting steps you can take to identify and resolve the problem.

** Here are some potential issues to look for and how to address them:**

**Check your criteria range**: Make sure that your criteria range includes the correct column headers and criteria, and that there are no blank cells or extra rows included. If the criteria range is incorrect, the function may be including or excluding data incorrectly.**Check your database range**: Make sure that your database range includes all the necessary columns and rows of your data, and that there are no gaps or extra columns included. If the database range is incorrect, the function may be averaging the wrong values.**Check your field argument**: Double-check that your field argument correctly identifies the column or field you want to average. If this argument is incorrect, the function will return incorrect results.**Check for errors in your data**: Make sure that there are no errors in the cells being averaged, such as #NA or #DIV/0!. If any of the cells in your database range contain errors, the function may return unexpected results.**Check your syntax**: Make sure that your formula includes all the necessary arguments, and that they are entered correctly. Be sure to use commas to separate the arguments, and to enclose any text strings in double quotes.**Try using other functions**: If you’re still having trouble getting accurate results with the DAVERAGE function, try using other functions like AVERAGEIF, AVERAGEIFS, or SUMPRODUCT to filter and average your data. These functions may offer more flexibility or precision in filtering your data based on specific criteria.

By checking these potential issues and making any necessary adjustments to your formula or data, you should be able to troubleshoot most problems with the DAVERAGE function in Excel and get the expected results you need.

## Wildcards with the criteria for the DAVERAGE function

Yes, it is possible to use wildcards with the criteria for the DAVERAGE function in Excel.

Wildcards are characters that can be used to represent one or more other characters, allowing you to filter and average your data based on patterns rather than exact values.

To use wildcards in the criteria for the DAVERAGE function, you can include them in the criteria range using the asterisk (*) symbol.

The * symbol can be used to represent any number of characters, while the ? symbol can be used to represent a single character.

Here’s an example to illustrate how to use wildcards with the DAVERAGE function:

Suppose you have a table of sales information that includes columns for Salesperson Name, Region, Product Type, and Sales Amount.

You want to calculate the average sales amount for salespeople who sold any product that begins with the letter “W”.

Here’s what the criteria range might look like, assuming your data starts in cell A2:

A | B | |
---|---|---|

1 | Product Type | |

2 | W* |

To specify this criterion in the DAVERAGE function, you would use the following formula:

**=DAVERAGE(A2:D11,"Sales Amount",A1:B2)**

This tells Excel to look at the range of cells A2:D11 as the database, average the values in the “Sales Amount” column (which is the fourth column), and only include rows where the Product Type begins with the letter “W”.

Note that when using wildcards with the DAVERAGE function, you need to make sure you are using them correctly and not overusing them, as this can lead to inaccurate results.

You should also be careful to combine wildcards with other criteria as needed to filter the data more precisely.

Overall, using wildcards with the criteria for the DAVERAGE function can be a powerful tool for analyzing complex data patterns and deriving insights from your Excel data.

## DAVERAGE vs. Other Average Functions in Excel: What Makes It Different?

The DAVERAGE function in Excel is one of several different functions that can be used to calculate averages and other statistical measures for subsets of data.

While it shares some similarities with other average functions, such as AVERAGEIF and AVERAGEIFS, there are some key differences that set it apart.

**Here are a few ways in which the DAVERAGE function differs from other average functions in Excel:**

**Criteria-based filtering**: The DAVERAGE function allows you to filter your data and calculate averages based on specific criteria, using a separate criteria range. This allows you to analyze subsets of your data more precisely and get more accurate results than if you simply used an average function like AVERAGE or AVERAGEA.**Database-oriented approach**: The DAVERAGE function works by treating your data as a database, with columns defined by headers and rows containing information about specific records or observations. This approach can make it easier to work with large amounts of data and calculate averages for specific fields or groups of fields.**Case-sensitive comparisons**: When using the DAVERAGE function, comparisons between values are case-sensitive, meaning that “Sales” and “sales” would be treated as different criteria. This can be important to keep in mind when working with text data and trying to filter data based on specific strings or patterns.**No support for arrays**: Unlike some other average functions in Excel, such as AVERAGE and AVERAGEA, the DAVERAGE function does not support array formulas. This means that you cannot use it to calculate averages across multiple ranges or arrays of data in a single formula.

## Can the DAVERAGE function be used with non-numeric data?

No, the DAVERAGE function in Excel is designed to work specifically with numeric data and cannot be used with non-numeric data.

This is because the function calculates averages based on arithmetic calculations, which require numerical input.

If you try to use the DAVERAGE function with non-numeric data, you will get a #VALUE! error.

For example, if you have a column of text values and use the DAVERAGE function to calculate the average value of that column, you will get an error because the function cannot perform arithmetic calculations on text values.

It’s worth noting that there are other functions in Excel that can be used to calculate averages for non-numeric data types.

For example, the AVERAGEIF function allows you to calculate averages for cells that meet specific criteria or contain certain text or logical values.

The MODE function can be used to find the most common value in a range of cells, regardless of whether they are numeric or non-numeric.

Overall, while the DAVERAGE function may not be suitable for working with non-numeric data types, there are other tools available in Excel that can help you analyze and summarize this type of information more effectively.