Solved

Average a range of numbers AVERAGEIF

Posted on 2011-09-08
3
304 Views
Last Modified: 2012-05-12
I am trying to average a range of cells using an AVERAGEIF formula.
I only want to average if cell in A=4, then I want to average all numbers between columns S & AD.
AVERAGEIF(A:A,4,S:AD)
What I am now realizing is that it is ONLY averaging column S, not columns S thru AD.
Is there a formula that will average all the numbers in all the columns?
Thanks!
0
Comment
Question by:Euro5
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 50

Accepted Solution

by:
barry houdini earned 500 total points
ID: 36506986
You have to use an array formula, e.g.

=AVERAGE(IF(A:A=4,IF(ISNUMBER(S:AD),S:AD)))

confirmed with CTRL+SHIFT+ENTER

To do this place formula in cell then press F2 to select formula - hold down CTRL and SHIFT keys and press ENTER. If done correctly then curly braces like { and } will appear around the formula in the formula bar.

Note that the above will be quite slow because it looks at whole columns - best to limit to a fixed range, e.g. rows 1 to 100 like this

=AVERAGE(IF(A1:A100=4,IF(ISNUMBER(S1:AD100),S1:AD100)))

regards, barry
0
 
LVL 50

Expert Comment

by:barry houdini
ID: 36507009
....or you can use this longer "non-array" version

=SUMPRODUCT((A1:A100=4)*(S1:AD100))/SUMPRODUCT((A1:A100=4)*ISNUMBER(S1:AD100))

won't work if there is any text in S1:AD100.....

regards, barry
0
 

Author Closing Comment

by:Euro5
ID: 36507202
Perfect - options & explainations. Can't do better than that!
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question