Excel - AVERAGEIF Function



AVERAGEIF Function

The Excel AVERAGEIF function is another variation of the AVERAGE function and is listed in the Statistical function. It makes it easier for users to determine the arithmetic mean based on a specific constraint. If the constraint is matched, then the AVERAGEIF function returns the average; otherwise, it retrieves the #DIV/0! Error. Additionally, use the AVERAGEIFS function if you are willing to calculate the average using several criteria.

Compatibility

This advanced Excel function is compatible with the following versions of MS-Excel −

  • Excel for Microsoft 365
  • Excel for Microsoft 365 for Mac
  • Excel for the web
  • Excel 2024
  • Excel 2024 for Mac
  • Excel 2021
  • Excel 2021 for Mac
  • Excel 2019
  • Excel 2016
  • Excel Web App
  • Excel 2013
  • Excel 2010
  • Excel 2007

Syntax

The syntax of the AVERAGEIF function is as follows −

=AVERAGEIF(range, criteria, [average_range])

Arguments

You can use the following arguments with the AVERAGEIF function −

Argument Description Required/Optional
Range It may contain a numeric value, arrays, or cell references that point to a numeric value required to calculate the arithmetic mean. Required
Criteria It represents the specific condition regarding cell reference, expression, numeric value, or letters. Required
Average_range It indicates the actual range of cells to be used for the arithmetic mean. The range will be employed if skipped. Optional

Points to Remember

  • The AVERAGEIF function supports wildcard characters: a single character is represented by the (?), and multiple characters are denoted by the asterisk(*).
  • If the arguments contain the text or Boolean values, then the AVERAGEIF function will exclude those data types. However, zero values are included.
  • If the criteria argument points to a blank cell, it is considered as 0 value.
  • If the criteria are not fulfilled, then the AVERAGEIF function yields the #DIV/0! error.
  • If the average_range points to the blank cell, the function avoids it.

Examples of AVERAGEIF Function

Practice the following examples to learn the use of the AVERAGEIF function in Excel.

Example 1: How to use the AVERAGEIF function in Excel?

In this example, the arithmetic mean of the sales across different regions is evaluated based on the provided constraints.

Solution

Step 1 − The quarterly sales of the different regions are depicted in the cell range C4:E7. You need to compute the average of those sales whose value is greater than or equal to 5000. Write the formula =AVERAGEIF(C3:E6,">=5000") in the C8 cell.

AVERAGEIF Function

Step 2 − After that, hit the Enter tab. Therefore, the AVERAGEIF function will return the 7400 as a result.

AVERAGEIF Function 1

Step 2 − In a similar way, you may write the formula =AVERAGEIF(C4:E4,">=5000") in the C9 cell and press Enter.

AVERAGEIF Function 2

Here, the cells C4 and D4 contain larger values than 5000, so the arithmetic mean of these cell values is to be taken place.

AVERAGEIF Function 3

Step 3 − Furthermore, you may write the formula =AVERAGEIF(C5:E6,">=20000") in the C10 cell.

AVERAGEIF Function 4

Therefore, the AVERAGEIF function returns the #DIV/0! Error as the specified criteria is not True.

AVERAGEIF Function 5

Example 2: How to find the Arithmetic mean(Average) using the wildcard characters?

In this example, we will use the wildcards in the criteria of the AVERAGEIF function.

Solution

Step 1 − First, select the cell E9 and enter the formula =AVERAGEIF(B3:B6,"????",C3:E6). In this AVERAGEIF expression, the average of the cell range C3:E6 is evaluated, comprising only four letters in the cell range B3:B6. The East and West regions in the given dataset contain only four characters.

AVERAGEIF Function 6

Therefore, the AVERAGEIF function gives you the result of 7900.

AVERAGEIF Function 7

Step 2 − If you are willing to find out the average sales of the month that has e character. So, the expression will be =AVERAGEIF(C2:E2,"*e*",C3:C6) as defined in the E10 cell. Here, we use two asterisks before and after the character, which means the character is preceded and followed by other characters in the front and rear of the e character.

AVERAGEIF Function 8

Hence, the AVERAGEIF function retrieves the arithmetic mean of 6000.

AVERAGEIF Function 9

Download Practice Sheet

You can download and use the sample data sheet to practice the AVERAGEIF function.

Advertisements