View Single Post
Old 25th February 2017, 16:25   #9
uk_dave&gill
This is my second home
 
..

Join Date: Feb 2007
Location: Town
Posts: 4,166
Thanks: 1
Thanked 189 Times in 105 Posts
Default

Quote:
Originally Posted by HarryM1BYT View Post
=AVERAGE(Y5:Y60) provides an average value for all of the rows. I want to not count the ones with no data in them.

Sorted! - =AVERAGEIF(Y5:Y60,">0")
Darn, you got yourself sorted before I could look at this!

I can't use AVERAGEIF as I am still resolutely sticking with Excel 2003. I do have 2007 as well, but don't like the ribbon interface and also there's lots of things that 2007 will do natively that 2003 won't and finding ways to do them programatically is more fun!

This will work for 2003, and ignores not only zeros, but blanks and text as well!

=SUM(Y5:Y60)/SUMPRODUCT((Y5:Y60<>0)*ISNUMBER(Y5:Y60))
__________________
Dave
uk_dave&gill is offline   Reply With Quote