Formula for average

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.
 
F

Frank Kabel

Hi Kelly
try the following array formula (entered with CTRL+SHIFT+ENTER):
=AVERAGE(IF(A1:D1>0,A1:A1))
 
D

DDM

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))
 
J

JE McGimpsey

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)),"")
 
H

Harlan Grove

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top