Statistical Excel 2007 ◉ 7 views

=AVERAGEIF()

Returns the average (arithmetic mean) of all the cells in a range that meet a given criteria.

Applies To: Excel for Microsoft 365Excel for Microsoft 365 for MacExcel 2024Excel 2024 for MacExcel 2021Excel 2021 for MacExcel 2019Excel 2016Excel Web App
=AVERAGEIF(range, criteria, [average_range])
Hover argument names in the table for details.
Output typeNumber
Popularity40 / 100
VolatileNo
Dynamic ArrayNo
📥 Download sample .xlsx — Coming soon ▦ Try in Playground Dedicated file for this function — safe & lightweight · sample data + live formulas
Share:

⬇ Download Sample Workbook

A dedicated .xlsx for =AVERAGEIF() with Persian sample data & live formulas — open in Excel and practice.

  • Sheet “Sample” — data table + formula in place
  • Sheet “Guide” — syntax, arguments & tips from this page
  • Instant & secure (token + rate limit)
📥 Download AVERAGEIF.xlsx — Coming soon ~ 8–12 KB · No macros

⇪ Share

Send this function to friends

🧠 🧠 Quiz this function

%d questions — syntax, example & errors — test yourself!

◧ Arguments

ArgumentTypeRequiredDescription
range Range Required One or more cells to average, including numbers or names, arrays, or references that contain numbers.
criteria Any type Required The criteria in the form of a number, expression, cell reference, or text that defines which cells are averaged. For example, criteria can be expressed as 32, "32", ">32", "apples", or B4.
average_range Range Optional The actual set of cells to average. If omitted, range is used.

▣ Examples

▦ Data
CellValue
A2 Property Value
B2 Commission
A3 100000
B3 7000
A4 200000
B4 14000
A5 300000
B5 21000
A6 400000
B6 28000
A7 Region
B7 Profits (Thousands)
A8 East
B8 45678
A9 West
B9 23789
A10 North
B10 -4789
A11 South (New Office)
B11 0
A12 MidWest
B12 9678
A13 Property Value
B13 Commission
A14 100000
B14 7000
A15 200000
B15 14000
A16 300000
B16 21000
A17 400000
B17 28000
A18 Region
B18 Profits (Thousands)
A19 East
B19 45678
A20 West
B20 23789
A21 North
B21 -4789
A22 South (New Office)
B22 0
A23 MidWest
B23 9678
Average of all commissions less than 23000. Three of the four commissions meet this condition, and their total is 42000. =AVERAGEIF(B2:B5,"<23000")
Result: 14000
Average of all property values less than 250000. Two of the four property values meet this condition, and their total is 300000. =AVERAGEIF(A2:A5,"<250000")
Result: 150000
Average of all property values less than 95000. Because there are 0 property values that meet this condition, the AVERAGEIF function returns the #DIV/0! error because it tries to divide by 0. =AVERAGEIF(A2:A5,"<95000")
Result: #DIV/0!
Average of all commissions with a property value greater than 250000. Two commissions meet this condition, and their total is 49000. =AVERAGEIF(A2:A5,">250000",B2:B5)
Result: 24500
Average of all profits for the West and MidWest regions. =AVERAGEIF(A2:A6,"=*West",B2:B6)
Result: 16733.5
Average of all profits for all regions excluding new offices. =AVERAGEIF(A2:A6,"<>*(New Office)",B2:B6)
Result: 18589

§ Remarks

  • 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 a blank or text value, AVERAGEIF returns the #DIV0! error value.
  • If a cell in criteria is empty, AVERAGEIF treats it as a 0 value.
  • If no cells in the range meet the criteria, AVERAGEIF returns the #DIV/0! error value.
  • You can use the wildcard characters, question mark (?) and asterisk (*), in criteria. A question mark matches any single character; an asterisk matches any sequence of characters. If you want to find an actual question mark or asterisk, type a tilde (~) before the character.
  • Average_range does not have to be the same size and shape as range. The actual cells that are averaged are determined by using the top, left cell in average_range as the beginning cell, and then including cells that correspond in size and shape to range. For example:
  • Average which is the arithmetic mean, and is calculated by adding a group of numbers and then dividing by the count of those numbers. For example, the average of 2, 3, 3, 5, 7, and 10 is 30 divided by 6, which is 5.
  • Median which is the middle number of a group of numbers; that is, half the numbers have values that are greater than the median, and half the numbers have values that are less than the median. For example, the median of 2, 3, 3, 5, 7, and 10 is 4.
  • Mode which is the most frequently occurring number in a group of numbers. For example, the mode of 2, 3, 3, 5, 7, and 10 is 3.
  • For a symmetrical distribution of a group of numbers, these three measures of central tendency are all the same. For a skewed distribution of a group of numbers, they can be different.

✦ Tips

  • 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 a blank or text value, AVERAGEIF returns the #DIV0! error value.
  • If a cell in criteria is empty, AVERAGEIF treats it as a 0 value.
  • You can use the wildcard characters, question mark (?) and asterisk (*), in criteria. A question mark matches any single character; an asterisk matches any sequence of characters. If you want to find an actual question mark or asterisk, type a tilde (~) before the character.
  • Average_range does not have to be the same size and shape as range. The actual cells that are averaged are determined by using the top, left cell in average_range as the beginning cell, and then including cells that correspond in size and shape to range. For example:
  • Average which is the arithmetic mean, and is calculated by adding a group of numbers and then dividing by the count of those numbers. For example, the average of 2, 3, 3, 5, 7, and 10 is 30 divided by 6, which is 5.
  • Median which is the middle number of a group of numbers; that is, half the numbers have values that are greater than the median, and half the numbers have values that are less than the median. For example, the median of 2, 3, 3, 5, 7, and 10 is 4.
  • Mode which is the most frequently occurring number in a group of numbers. For example, the mode of 2, 3, 3, 5, 7, and 10 is 3.
  • For a symmetrical distribution of a group of numbers, these three measures of central tendency are all the same. For a skewed distribution of a group of numbers, they can be different.

⚠ Common Errors

#DIV/0! If no cells in the range meet the criteria, AVERAGEIF returns the #DIV/0! error value.
Fix: Check the criteria or handle the error with IFERROR

💬 Comments & Q&A 0 approved

🔒 Your comment will be published after review.

Share your thoughts — visible after admin approval

No comments yet — be the first!

✍️ Add comment / question

captcha
🔒 Your comment will be published after review.