View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Lars-Åke Aspelin[_2_] Lars-Åke Aspelin[_2_] is offline
external usenet poster
 
Posts: 913
Default Need help with a formula

On Sat, 23 Jan 2010 15:55:01 -0800, dbconn
wrote:

I am looking for a formula that will compute an average of a number of non
contiguous cells such as G8, G16, G24, G36, etc. Each of these cells has a
formula which computes an average of a range of cells. With the helpm of
this forum, I have been able to find a formula which does that AND uses
values only when they are greater than zero and does not display #DIV/0!.
But I cannot fin a fromula that will do the next step- Take an average of
those specific cells AND use only the ones where the cell is 0, Example
G8=100, G16=85, G24 is blank, G36=75, then this formula would calculate the
average 100+85+75/3.

All help greatly appreciated


For you example, try this formula:

=SUM(G8,G16,G24,G36)/SUM(G80,G160,G240,G360)

If your data is more regular, say every 8th row, ie G32 rather than
G36, you may try something like this:

=SUMPRODUCT((G8:G32)*(MOD(ROW(G8:G32),8)=0))/SUMPRODUCT((G8:G320)*(MOD(ROW(G8:G32),8)=0))

This is a longer formula if you only have a few data, but if you have
data in every 8th row from cell G8 to say cell G400, then this is
shorter.

Hope this helps / Lars-Åke