The AVERAGEIF function evaluates the average of all numbers in a range that meet a given criterion. The formula for the AVERAGEIF is: The AVERAGEIFS function returns the average of all numbers in a range that meets multiple criteria. The formula for AVERAGEIFS is:

Syntax of AVERAGEIF and AVERAGEIFS

AVERAGEIF

Range: is the group of cells you want to average. The Range is required.Criteria: The Criteria is used to verify which cells to average. Criteria are required.Average_range: The Range of cells to average. When absent, the range parameter will be average instead. Average_range is optional.

AVERAGEIFS

Average_range: The Average_ Range is one or more cells to average. Average_range is required.Range: the group of cells you want to average. The Range is required.Criteria_range1: The first Range to evaluate the related criteria. The first Criteria_range1 is required, but the second criteria_ range is optional.Criteria 1: The Criteria verify which cells to average. The first criteria are required. The second criteria or any criteria after is optional.

How to use AVERAGEIF in Excel

First, we are going to click the cell where we want the Average. Then type =Averageif bracket. Inside the bracket, we will type the Range because the Range of cells contains the data we want to average. In this tutorial, we will type the cell (D3:D9), or we can click on the cell in the column that we want to average and drag it to the end; this will automatically place the range of cells in the formula. Now, we are going to enter the Criteria; the criteria validate which cells to average. We are going to use Bread in this tutorial because it is what we are looking for. We are going to enter the Average_ range. We will type G3:G9 because these cells contain the sales we want to average; then close the bracket.

Press Enter, you will see the result.

The other option is to go to Formulas. In the Function Library group, select More Functions. In the drop-down menu list, select Statistical in its menu choose AVERAGEIF. A Function Argument dialog box will appear.

In the Function Arguments dialog box, where you see Range, type D3:D9 into its entry box. In the Function Arguments dialog box, where you see Criteria, type “Bread” into the criteria entry box. In the Function Arguments dialog box, where you see Average_range, type G3:G9 into its entry box. Click OK and you will see your result. Read: How to use SUMIF and SUMIFS Functions in Excel

How to use AVERAGEIFS in Excel

In this tutorial, we are going to look up the average sale of products bought by customer 110. Click the cell where you want the result in, then type =Averageif, bracket. In the bracket type G3:G9, this is the Average_range. Now we are going to type the Criteria_range1. Type D3:D9, this range of cells contain the data we are looking for. We will type the Criteria1, which is” Bread” because it is the product we are looking for. We are going to fine Criteria_range2, which is A3:A9 because we want to identify the customer. We will enter Criteria2, which is“110,” because this is the ID number of the customer we are looking for.

Press Enter and you will see your result.

The other option is to go to Formulas. In the Function Library group, select More Functions. In the drop-down menu list, select Statistical in its menu select AVERAGEIFS; and a Function Argument dialog box will appear.

In the Function Arguments dialog box, where you see Average_range. Type G3:G9 in its entry box. In the Function Arguments dialog box, where you see Criteria_range1. Type D3:D9 in its entry box. In the Criteria1 entry box, type Bread. In the Criteria_range2 entry box, type A3:A9. In the Criteria2 entry box, type “110” because we are looking for the customer id 110. Click OK. You will see the result. Read next: How to use the IF Function in Excel.