ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   getting rid of a #Div/0! error (https://www.excelbanter.com/excel-discussion-misc-queries/169191-getting-rid-div-0-error.html)

StephenAccountant

getting rid of a #Div/0! error
 
here is my formula - it is an array formula.

=AVERAGE(IF(D9:G9<0,D9:G9))

if the cells all show up as blank or nil - i get a #Div/0! error - how can I
stop that from happening?

Bernard Liengme

getting rid of a #Div/0! error
 
=iF(COUNT(D9:G9)0,AVERAGE(IF(D9:G9<0,D9:G9)),"")
too late for me to test it!
best wishes
--
Bernard V Liengme
Microsoft Excel MVP
www.stfx.ca/people/bliengme
remove caps from email

"StephenAccountant" wrote in
message ...
here is my formula - it is an array formula.

=AVERAGE(IF(D9:G9<0,D9:G9))

if the cells all show up as blank or nil - i get a #Div/0! error - how can
I
stop that from happening?




dksaluki

getting rid of a #Div/0! error
 
On Dec 10, 9:04 pm, StephenAccountant
wrote:
here is my formula - it is an array formula.

=AVERAGE(IF(D9:G9<0,D9:G9))

if the cells all show up as blank or nil - i get a #Div/0! error - how can I
stop that from happening?


how about putting the IF statement outside the average statement? it
worked for me, but it returned 0 when even one of the cells in that
range were 0. is that what you want? if it is, then it worked for
me! don't know why it didn't work for you.



All times are GMT +1. The time now is 08:55 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com