I need to return an average for the following ranges E5, E9:13, E17:21, E25:29, E34:37 only and not count any zeros. I have tried multiple options with sum/countif, averageif, etc., and I must be missing something. If there a solution? TIA
I need to return an average for the following ranges E5, E9:13, E17:21, E25:29, E34:37 only and not count any zeros. I have tried multiple options with sum/countif, averageif, etc., and I must be missing something. If there a solution? TIA
Last edited by Alphabex; 05-15-2015 at 01:18 PM.
have you just tried =AVERAGE(E5, E9:E13, E17:E21, E25:E29, E34:E37)? The average function ignores blanks.
corrected for clarity
Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
Sam Capricci
Yes, I want it to ignore zeros, not blanks.
I tried this on some data with zeros and blanks and it appeared to work, maybe you can adapt it to your range?
=AVERAGEIF(H583:H590,"<>0",H583:H590)
EDIT: and it also works without the second range... =AVERAGEIF(H583:H590,"<>0")
it does not work because I have multiple ranges that I want to include. (E5, E9:E13, E17:E21, E25:E29, E34:E37)
without seeing your data this is the latest I could come up with that works in my sample data. I know the items included are contiguous but they were entered as ranges, see if it works for your ranges...
=SUM(E5,E9:E13,E17:E21,E25:E29,E34:E37)/(COUNTIF(E5,"<>0")+COUNTIF(E9:E13,"<>0")+COUNTIF(E17:E21,"<>0")+COUNTIF(E25:E29,"<>0")+COUNTIF(E34:E37,"<>0"))
EDITed, adjusted to your ranges.
Last edited by Sam Capricci; 05-14-2015 at 06:55 PM.
Victory!!!!!!!!I need to remember this formula, I will use it many times. Thank you!
Great, glad that worked for you. If solved please mark your post as solved using the thread tools dropdown at the top of the post.
and if you're inclined clicking on *Add Reputation helps us advance on this forum.![]()
Your ranges need to be fully populated (with numbers) for that formula to work, though, because blank cells, for example, will be counted by the COUNTIF functions
This version will work assuming you don't need to accommodate negative values, will also handle blanks
=SUM(E5,E9:E13,E17:E21,E25:E29,E34:E37)/INDEX(FREQUENCY((E5,E9:E13,E17:E21,E25:E29,E34:E37),0),2)
It's possible, if you want, to give your discontiguous ranges a single name, and then use the name only, i.e.
=SUM(Range1)/INDEX(FREQUENCY(Range1,0),2)
Audere est facere
I've been trying to find something like this for weeks. VICTORY! Although it's 6.5 years later, I appreciate finding this! THANK YOU!!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks