A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

#DIV/0! error



 
 
Thread Tools Display Modes
  #1  
Old January 21st, 2010, 12:43 PM posted to microsoft.public.excel.misc
dbconn
external usenet poster
 
Posts: 16
Default #DIV/0! error

I have the following formula entered to compute the average of a range of
cells and discount zeros. Until I change one of the zeros to a number, I get
#DIV/0!, How do I get rid of this

My formula is: =AVERAGE(Q8:Q18,"0",Q8:Q18)
--
dbconn
  #2  
Old January 21st, 2010, 01:11 PM posted to microsoft.public.excel.misc
David Biddulph
external usenet poster
 
Posts: 8,714
Default #DIV/0! error

That formula will not give you either your required value or a #DIV/0!
error. It will return #VALUE! because one of the 23 values which you have
asked it to average is the text string "0". The other 22 numbers which
you are asking it to average are two instances each of the elements in the
array Q8:Q18.

Perhaps you have fallen into the trap of typing into the newsgroup the
formula that you thought you were using, rather than copying the actual
formula from the formula bar and pasting it here.

The formula which you may have intended might have been the *array* formula
=AVERAGE(IF(Q8:Q180,Q8:Q18,"")) [entered with Control Shift Enter]. That
formula will indeed return #DIV/0! if there are no non=zero numbers in the
array Q8:Q18, so you may want something like
=IF(COUNT(Q8:Q18)-COUNTIF(Q8:Q18,0)=0,"",AVERAGE(IF(Q8:Q180,Q8:Q18 ,"")))
[again as an array formula].
--
David Biddulph

"dbconn" wrote in message
...
I have the following formula entered to compute the average of a range of
cells and discount zeros. Until I change one of the zeros to a number, I
get
#DIV/0!, How do I get rid of this

My formula is: =AVERAGE(Q8:Q18,"0",Q8:Q18)
--
dbconn



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 03:47 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.