View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
vezerid vezerid is offline
external usenet poster
 
Posts: 751
Default Formula Too Long

Tom, I did the following experiment:

In range A1:G22 I selected randomly 4 cells. I entered their addresses
in H1:H4 (e.g. A3, G4 etc).
Then I used the following formula:

=SUMPRODUCT(A1:G22*ISNUMBER(MATCH(ADDRESS(ROW(A1:G 22),COLUMN(A1:G22),4),H1:H4,0)))/SUMPRODUCT(--ISNUMBER(MATCH(ADDRESS(ROW(A1:G22),COLUMN(A1:G22), 4),H1:H4,0)))

It worked. Does this provide a basis for what you want to do?

One thing that can complicate the formula is having the cells in
different worksheets. ALso if the containing range is too big
SUMPRODUCT might have a problem. In this case you can use SUM instead
of SUMPRODUCT but you must array enter it (Ctrl+Shift+Enter).

Another thing that can simplify your task is to first color the cells
that you want to include and then use a user-defined formula to build
the list of cells automatically. There are several posts in this group
that show how to write such a function that can detect the format.

HTH
Kostis Vezerides

Tom Young wrote:
I'm trying to average the values in approximately 250 non-adjacent cells
(there is no pattern to the cell location).

My first obstacle was the 30 argument limit, which I hoped to get around by
using =AVERAGE (()). In another thread someone referred to this as using
"multiple area ranges."

That seemed to be working fine until about one hour into the tedious process
of selecting cells while holding down ctrl, I get the "too many characters"
notification.

Surely there is some efficient way of averaging more than 30 non-adjacent
cells?? I can't believe that Excel makes it this difficult to do a simple
calculation. Any suggestions? Thanks.