View Single Post
  #12   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Harlan Grove Harlan Grove is offline
external usenet poster
 
Posts: 733
Default #DIV/0! How do I remove this answer?!?!?

Max wrote...
One way

Try, array-entered:
=IF(ISERROR(AVERAGE(IF(('Summary Days'!$D$3:$D$1500="2A")
*('Summary Days'!$K$3:$K$1500=38)
*('Summary Days'!$O$3:$O$1500<0),'Summary Days'!$O$3:$O$1500))),
"",AVERAGE(IF(('Summary Days'!$D$3:$D$1500="2A")
*('Summary Days'!$K$3:$K$1500=38)
*('Summary Days'!$O$3:$O$1500<0),'Summary Days'!$O$3:$O$1500)))

....

Too inclusive. The OP's formula would only have returned #DIV/0! if
there had been no cells matching the criteria. That's easily tested
using COUNT.

=IF(COUNT(('Summary Days'!$D$3:$D$1500="2A")
*('Summary Days'!$K$3:$K$1500=38)
*ISNUMBER('Summary Days'!$O$3:$O$1500)),
AVERAGE(IF(('Summary Days'!$D$3:$D$1500="2A")
*('Summary Days'!$K$3:$K$1500=38)
'Summary Days'!$O$3:$O$1500)),"")

This has the advantage of propagating error values in these ranges, if
any, as well as not masking errors arising from nonconforming ranges.