How to Use AVERAGEIF in Google Sheets

By Tomosuke Hasegawa · Updated Oct 29, 2026 · Beginner · 5 min read · includes 2 free exercises

In short: AVERAGEIF averages the cells that meet a condition. The formula is =AVERAGEIF(criteria_range, criterion, [average_range]). If you leave out the average range, it averages the cells in the criteria range itself.

What AVERAGEIF does

AVERAGE gives the mean of everything in a range. AVERAGEIF gives the mean of only the rows that pass a test, such as the average score of one team or the average of all values above a threshold.

AVERAGEIF syntax

=AVERAGEIF(criteria_range, criterion, [average_range])

A step-by-step example

Here are five scores by team in cells A1:B6.

AB
1TeamScore
2Sales82
3Support64
4Sales91
5Support77
6Sales58

To find the average score of the Sales team:

=AVERAGEIF(A2:A6, "Sales", B2:B6)

This returns 77. Here is why:

  1. Sheets finds the rows where column A is Sales: rows 2, 4 and 6.
  2. It averages the matching cells in column B: (82 + 91 + 58) / 3 = 77.

Test and average the same range

When the condition is about the numbers themselves, you can skip the third argument. To average only the scores above 60:

=AVERAGEIF(B2:B6, ">60")

This returns 78.5, the average of 82, 64, 91 and 77. To compare against a value in a cell, join the operator and the reference: "<"&F1.

Common AVERAGEIF mistakes

Try it yourself

Use the score table above (A1:B6). Type your formula into the box, starting with =, then press Check.

Exercise 1: Average by team

Write a formula that returns the average Score (column B) for the Sales team (column A).

Hint: test A2:A6 against "Sales", average B2:B6.

Exercise 2: Average above 60

Write a formula that returns the average of the scores in B2:B6 that are greater than 60.

Hint: no third argument is needed.

What to learn next

Syntax and rules in this guide were checked against Google's AVERAGEIF help page. See all guides.