how do I get AVERAGE to ingore a zero value cell

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am using the AVERAGE function but if i have two cells where one is "0" how
do I get it to preserve the first value rather than halving it?
E.G
what I need it to do is:
3+3 = 6, average score = 3
5+0 = 5 average score = 5
 
=IF(COUNTIF(A1:B1,0)<>0,SUM(A1:B1),AVERAGE(A1:B1))

or, if you need to extend this across more columns:

=SUM(A1:K1)/COUNTIF(A1:K1,"<>0")

or an array formula (enter with CTRL+SHIFT+ENTER):

=AVERAGE(IF(A1:K1<>0,A1:K1))
 
Mike,

Use

=AVERAGE(IF(A1:A10>0,A1:A10))

which is an array formula, so commit with Ctrl-Shift-Enter

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
Back
Top