[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Average a range of numbers AVERAGEIF

Posted on 2011-09-08
3
Medium Priority
?
311 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 2000 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

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 …
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

650 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