View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Domenic
 
Posts: n/a
Default Ignore errors when calculation average of multiple ranges

Try...

=AVERAGE(IF(1-ISNUMBER(MATCH(COLUMN(D4:AG4)-COLUMN(D4)+1,{14,15,16,17},0)
),IF(ISNUMBER(D4:AG4),D4:AG4)))

....confirmed with CONTROL+SHIFT+ENTER.

Notes:

1) The array constant {14,15,16,17} determines which columns, relative
to the first column in your range (Column D), to exclude in your
average. In this case, Columns 14 through 17 are excluded.

2) Empty cells will not be counted.

Hope this helps!

In article ,
joshkraemer
wrote:

I'll make this short and brief.

Here's what works:

{AVERAGE(IF(ISERROR(D4:P4),"",D4:P4))}

Here's what I want to do (but doesn't work):

{AVERAGE(IF(ISERROR(D4:P4,U4:AG4),"",D4:P4,U4:AG4) )}

What am I doing wrong? I want to be able to ignore all errors when
calculating an average for _multiple_(2)_ranges_ (D4:P4 and U4:AG4, not
just D4:P4).

Thanks in advance for the help.