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

"joshkraemer" wrote:
Here's what I want to do (but doesn't work):
{AVERAGE(IF(ISERROR(D4:P4,U4:AG4),"",D4:P4,U4:AG4) )}
[....] I want to be able to ignore all errors when calculating
an average for _multiple_(2)_ranges_


General form of the array formula (ctrl-shift-Enter):

=average(if(condition1,range1), if(condition2,range2), ...)

In your case:

=average(if(not(iserror(U2:P4)), U2:P4),
if(not(iserror(U4:AG4)), U4:AG4))

PS: Personally, I would avoid the errors within the ranges
in the first place. Makes for a less messy spreadsheet.