Averaging non-contiguous cells with zeros

Scabby

New Member
Joined
Aug 19, 2002
Messages
3
Hi!
I know how to average contiguous cells containing zeros so that the zeros are not counted, ie. =sum(range)/max(1,count(range)-countif(range,0))

I need to know how to do this with non-contiguous cells if possible. For instance: I need to average cells b1, b10, b20, b30 where b1 = 12, b10 = 15, b20 = 0, and b30 = 20. I don't want to calculate the cell with the zero. What's the formula? Thanks in advance!!!
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
Howdy, I placed the cells in a named range called "MyRange" and played with the following:
Book3
BCDE
155DavidHagerArray
25SeparateCountIfs
35#VALUE!Yogi'ssuggestion(WhathaveIdonewrong?)
4
50
6
75
Sheet1


_________________
Cheers,<font size=+2><font color="red"> Nate<font color="blue"> Oliver</font></font></font>
This message was edited by nateo on 2003-02-19 23:38
 
Upvote 0
Hi Nate:

For me it seems to work fine ...
Book1
ABCDE
15
2
355
4
50
6
75
8
Sheet4 (2)


I can't say as of now why our results don't agree -- but let us continue to look at it.
 
Upvote 0

Forum statistics

Threads
1,216,077
Messages
6,128,673
Members
449,463
Latest member
Jojomen56

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top