ExcelTip.com
ExcelTip.com
Account Icon Account Icon Account Icon
Google Exceltip.com
JOIN OUR NEWSLETTER
  and receive for joining:
Free eBook Learn More!
Free Excel ADD-IN
Free Weekly Excel Tip
4 e-books in cd-rom
F1 Formulas & Functions
F1 Formulas & Functions
F1 EXCEL
F1 eBook (Spanish)
F1 EXCEL
Financial Statements.xls
 

» Calculating the Average for Numbers Meeting Specified Criteria
Problem:

We want to calculate the average of all prices in column A that are higher than 200.

Solution:

Use the IF and AVERAGE functions in the following Array formula:
{=AVERAGE(IF(A2:A7>B2,A2:A7))}


Screenshot // Calculating the Average for Numbers Meeting Specified Criteria

Calculating the Average for Numbers Meeting Specified Criteria
Rate this tip
12 34 5
  RATING: 2.21
  VIEWS: 14010

READER COMMENTS (view all comments)


can make errors
Guest wrote on December 31, 1969 19:00 EST
Error: #DIV/0!
When: =AVERAGE(IF(RANGE1>F13;RANGE2))
if no culoumns are greater than F13
Diferent answer
Dwwon wrote on December 31, 1969 19:00 EST
I am getting 215 not 330?
I also get the value "215',,, BUT,,,read on
jay wrote on September 08, 2006 13:06 EST
Hi all,

I too get the value of "215" in cell C2 (which contains the formula as: =AVERAGE(IF(A2:A7>B2,A2:A7))

However, when I examine the formula using the fx icon (insert function) on the data entry menu bar, which brings up the "Function Arguments" pop-up window, it indicates that the formul result is "330"... This is strange,,,does anyone have a clue as to 'why' the displayed data in the cell is 215 and not the 330 as shown for a 'Formula result' ?
Edit and Array Formula
Chris wrote on December 31, 1969 19:00 EST
When you edit and Array Formula you must hit CTRL+SHIFT+ENTER, NOT just ENTER.
Calculating the average of numbers meeting criteria
sivanaresh wrote on September 10, 2006 11:00 EST
I am getting 215. When I tried to evaluate as to why it is 215 and not 330, the first validation of the function in the if block is to see if A2>200, and just becuase it is returning true, the Average function is calculating the average for the rest of the values (A2:A7).

Again, as Jay said earlier, if we see the value using function fx (Insert Menu), it is displaying 330.
Calculate the average of numbers meeting TWO criteria
Stephanie Davis wrote on September 29, 2006 14:35 EST
I use this formula =AVERAGE(IF(AG2:AG92="yes",Y2:Y92)) to average a set of numbers and it works. Now I need to add one more criteria met before calculation the average. I need the one column to = "Yes" and other column to be = to a certain name i.e. John Doe. I tried using =AVERAGE(IF(and(U2:U92=T96,AG2:AG92="yes"),Z$2:Z$92)) were T96 is a certain name, but it doesn't work. Can anyone help me out. Thanks. sd
array
fankairong wrote on October 05, 2006 18:35 EST
when you finish the function,use CTRL+ALT+ENTER ,
Try this!
Mauro Daud wrote on October 10, 2006 05:21 EST
:rolleyes: It is necessary in this formula to put the criteria in the cel (for example >200):

Prices Criteria
500,00 >200
200,00
150,00
40,00
230,00
110,00
260,00
Formula result [COLOR="Red"]330,00 [/COLOR]
=SUMIF(A2:A8;B2;A2:A8)/COUNTIF(A2:A8;B2)

Gabriela wrote on October 11, 2006 20:12 EST
Did you try finishing it with CTRL+ALT+ENTER instead of just hitting Enter?



REGISTERED USERS - Click here to post comments


GUESTS (Click here to register)
Name
Comment Title
Comments

The Basics of Finance: Financial Tools for Non Financial Managers

The South Beach Diet: The Delicious, Doctor-Designed, Foolproof Plan for Fast and Healthy Weight Loss

Financial Reporting and Analysis (2nd Edition)

The One Page Business Plan: Start With a Vision, Build a Company!

Analyzing Markets, Products, and Marketing Plans

Not-for-Profit Accounting Made Easy

RELATED MICROSOFT EXCEL TIPS


Convert PDF Files to Excel






Excel VBA books
Accounting books
Business Plans
MS Office books
Taxes books

VIEW ALL BOOKS


  Advertise With Us                               

Tips

Add-In in VBA | Applications - Word, Outlook in VBA | Array Formulas | Cells, Ranges, Rows, and Columns in VBA | Counting | Custom Functions | Custom Functions in VBA | Database Formulas | Database in VBA | Date & Time Formulas | Date & Time in VBA | Events in VBA | Excel 2003 | Excel Chart | Excel Consolidating | Excel Counting | Excel Custom Functions using VBA | Excel Customizing | Excel Data | Excel Dates | Excel Editing | Excel Files | Excel Filter | Excel Format | Excel Formula | Excel General | Excel Grouping and Outlining | Excel Importing Text Files | Excel Information | Excel Keyboard Shortcuts | Excel Loan Formulas | Excel Macros - VBA | Excel Pivot Tables | Excel Printing | Excel Range Name | Excel Security - Protection | Excel Sorting | Excel Style | Excel Subtotals | Excel Summing | Excel Text | Excel Time | Excel Tools | Excel Worksheet, Workbook | Files, Workbook, and Worksheets in VBA | Financial Formulas | Formating in VBA | General Topics in VBA | Import and Export in VBA | Information Formulas | Keyboard & Other Shortcuts in VBA | Keyboard Formula Shortcuts | Links between Worksheet and Workbooks | Links in VBA | Logical Formulas | Lookup Formulas | Mail - Send and Receive in VBA | Menus, Toolbars, Status bar in VBA | Modules, Class Modules in VBA | Other Q&A Formulas | Printing in VBA | Protecting in VBA | Summing | Text Formulas | User Forms, Input boxes in VBA | Using Loops | Working with Formulas |

Tips by Version

Microsoft Excel 97 | Microsoft Excel 2000 | Microsoft Excel 2002 | All Microsoft Excel Versions | New in Excel 2002 | New in Excel 2003 - Office 11

Website

Home | Tip of Hour | Recommended Tips | Most Viewed Tips | Tips by Version | Submit a Tip | My Tips
Microsoft Excel Tutorials | Excel Links | Write for Us | About Us | Search Results | Tip Archives | Excel Forum | Excel Forum Archives

Excel Book

Excel 97 Book | Excel 2000 Book | Excel 2002 Book | Excel XP Book | Book Store

Terms and Conditions of use
The applications/code on this site are distributed as is and without warranties or liability. In no event shall the owner of the copyrights, or the authors of the applications/code be liable for any loss of profit, any problems or any damage resulting from the use or evaluation of the applications/code.

Copyright © 2003 ExcelTip.com
Microsoft, Microsoft Excel is a U.S. registered trademark of Microsoft Corporation
Site Developed By: Varien