Statistical
Excel 2007
◉ 4 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
⬇ 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)
🧠 🧠 Quiz this function
%d questions — syntax, example & errors — test yourself!
◧ Arguments
| Argument | Type | Required | Description |
|---|---|---|---|
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
میانگین همه کمیسیونهای کمتر از ۲۳۰۰۰. سه کمیسیون از چهار کمیسیون این شرط را دارند و مجموع آنها ۴۲۰۰۰ است.
=AVERAGEIF(B2:B5,"<23000")
میانگین همه ارزشهای ملک کمتر از ۲۵۰۰۰۰. دو ارزش از چهار ارزش ملک این شرط را دارند و مجموع آنها ۳۰۰۰۰۰ است.
=AVERAGEIF(A2:A5,"<250000")
میانگین همه ارزشهای ملک کمتر از ۹۵۰۰۰. چون هیچ ارزش ملکی این شرط را ندارد، تابع AVERAGEIF خطای #DIV/0! را برمیگرداند زیرا میخواهد بر صفر تقسیم کند.
=AVERAGEIF(A2:A5,"<95000")
میانگین همه کمیسیونهایی که ارزش ملک آنها بیشتر از ۲۵۰۰۰۰ است. دو کمیسیون این شرط را دارند و مجموع آنها ۴۹۰۰۰ است.
=AVERAGEIF(A2:A5,">250000",B2:B5)
میانگین همه سودهای مناطق غرب و میدوست.
=AVERAGEIF(A2:A6,"=*West",B2:B6)
میانگین همه سودهای همه مناطق بهجز دفترهای جدید.
=AVERAGEIF(A2:A6,"<>*(New Office)",B2:B6)
✦ 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!