Returns the average of the values in a range that meet a given condition.
Syntax
test_range: The cell range containing values you want to test for the given condition. Eg., A2:A11
condition: The given test condition. It can be a number, a text string, or an expression. Eg., "Pencil"
Remarks
Ignores logical values (TRUE, FALSE) present in the cell range.
Examples
|
Formula |
Result |
|
=AVERAGEIF(A2:A11;"Pencil";B2:B11) |
54.5 |
|
=AVERAGEIF(A2:A11;"Binder";B2:B11) |
57.333333333 |
|
=AVERAGEIF(A2:A11;"Pen Set";B2:B11) |
81.4 |
Possible Errors
|
Errors |
Meaning |
|
#N/A! |
|
|
#NAME! |
|
|
#VALUE! |
|
|
#REF! |
|
|
#DIV/0! |
|
Similar Functions