AVERAGEIF Function - Excel


Overview


The AVERAGEIF function in Excel is a useful tool for calculating the average of a range of numbers based on a specified condition or criteria. This function allows you to specify a criteria, and then it calculates the average of the numbers that meet that criteria within a given range.

An example of the AVERAGEIF function in Excel

Example:

=AVERAGEIF(D2:D11, "run", C2:C11)

Syntax:

=AVERAGEIF(range, criteria, [average_range])

range: The range of cells that you want to apply the criteria to.

criteria: The condition that determines which cells to include in the average.

[average_range]: (Optional) The range of cells to average. If omitted, the function will use the same range specified in the "range" argument.


Example: without optional [average_range] input


In the example above, the AVERAGEIF function is looking at range C2:C11 and we gave it a condition to only average out the numbers that are greater than 8. The final output is 9.5 because it averaged out the only two numbers that are greater than 8 in that range, which were 9 and 10.


Example: with optional [average_range] input


In this example, the AVERAGEIF function is looking at range D2:D11 and if any of the rows meet the criteria of equaling “run” then the number in range C2:C11 of that same row will get averaged. The final output is 5.2 because 1, 4, 6, 7, and 8 were averaged out.

Another example of the AVERAGEIF function in Excel

Interactive GSheet