Formula for average

  • Thread starter Thread starter Kelly
  • Start date Start date
K

Kelly

I need a formula to average the following.

A B C D
1 100 0 90 0 =95

I need it to average only numbers > 0.
 
Hi Kelly
try the following array formula (entered with CTRL+SHIFT+ENTER):
=AVERAGE(IF(A1:D1>0,A1:A1))
 
Frank, a tiny correction in your formula (which I would never have spotted
if I hadn't tried it out):

=AVERAGE(IF(A1:D1>0,A1:D1))
 
That will be equivalent to

=A1

unless A1 <=0, which will return #DIV/0

Try (array entered):

=IF(COUNTIF(A1:D1,">0"),AVERAGE(IF(A1:D1>0,A1:D1)),"")
 
Kelly, like this (entered as an array):
=IF(A1:D1=0,0,AVERAGE(IF(A1:D1>0,A1:D1)))
...

While that works with the sample data {100,0,90,0) in A1:D1, what does this
formula give when A1:D1 contains {0,100,90,0}? The first argument to IF is
ill-posed.
 
Back
Top