The AVERAGEIF() function was new in Excel 2007.
Definition. This function calculates the average of all cells in a range that meet a specified criterion.
range (required). One or more cells to average, including numbers, names, arrays, or references that contain numbers.
criteria (required). The criteria—in the form of a number, an expression, a cell reference, or text—that define which cells are averaged.
average_range (optional). The actual set of cells to average. If average_range is not specified, range is used.
Cells in range that contain TRUE or FALSE are ignored.
If a cell in average_range is an empty cell, AVERAGEIF() ignores it. If range is empty or is a text value, ...