How to use Averageif function in Excel

Returns the average of all the cells in a range that meet a given criteria.

The AVERAGEIF function syntax has the following arguments:

Range:- Required. One or more cells to average, including numbers or names, arrays, or references that contain numbers.

Criteria:- Required. The criteria in the form of a number, expression, cell reference, or text that defines which cells are averaged.

Average_range:- Optional. The actual set of cells to average. If omitted, range is used.