How to Average with a Condition Using AVERAGEIF

AVERAGEIF averages only the rows that meet a condition — by room type, by length of stay, or by a wildcard pattern.

You will learn to

  • Average values for one category
  • Average with a numeric condition on another column
  • Average with a wildcard pattern

How it works

AVERAGEIF(range, criteria, [average_range]) checks each cell in range against the criteria and averages the matching values from average_range. =AVERAGEIF(B2:B11,"Suite",D2:D11) is the average nightly rate for suites only.

Criteria can be text, a comparison in quotes such as ">=3", or a wildcard such as "Deluxe*" (any text starting with Deluxe). If nothing matches, AVERAGEIF returns #DIV/0!. For two or more conditions, use AVERAGEIFS.

=AVERAGEIF(B2:B11,"Suite",D2:D11)