View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default How to refer to a range except one cell

Just use some helper cells:
in Z45, enter =B45
in Z46, enter =B46
in Z48, enter =B48
in Z49, enter =B49
in Z50, enter =B50

leave Z47 blank

then:

=IF(AND(B$470, B$53=2), B$47-AVERAGEIF(Z$45:Z$50, "0"), "-")


--
Gary''s Student - gsnu200909


"hs" wrote:

Hi,

I'm trying to average a range except one cell in the middle of that range
(or alternatively to condition on a range made of two separate sections). The
formula I'm trying to use is the following:

=IF(AND(B$470, B$53=2), B$47-AVERAGEIF(B$45:B$50, "0"), "-")

Except, instead of B45:B50 in AVERAGEIF, I want the range to be B45:B46 and
B48:B50 (i.e. without the cell B47).
Can anyone tell me how to use a split range with AVERAGEIF or how to tell it
not to look at cell B47?

Grateful for any advice. Thanks!