Using the average function

L

LostNFound

I am using the average function! But when there is no data in the cells to
average it returns the #DIV?0! how can I avoid this I would like it to be
blank
 
B

Bob Phillips

=IF(SUM(A1:A4)=0,"",AVERAGE(A1:A4))

--

HTH

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

Bob Phillips

Hi Myrna,

I thought about that after I sent it, especially as I thought that if there
were a similar negative and positive numbers, that would still SUM to 0. But
I then thought, it would also AVERAGE to 0, so does it really matter. So I
thought about it (ooh, for at least 10 secs), decided there was no real
disadvantage to SUM, so said no more. You can't even get rid of the =0 part
by inverting it,=IF(SUM(A1:A4),AVERAGE(A1:A4),"") so there is no loss there.

Can you think of a case where SUM would cause a problem?
 

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