View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Bassman62 Bassman62 is offline
external usenet poster
 
Posts: 117
Default Macro to go to last row with values and average previous 30 va

Mike,

Your formula works wonderfully. I'm picking it apart to gain a better
understand of the functions used and am perplexed by some portions.
If I enter into a cell ' =LARGE((B2:B1000<"")*ROW(B2:B1000),31) ', the
result is #NUM error.
How does ' (B2:B1000<"")*ROW(B2:B1000) ' evaluate to an array for the
"Large" function? and Why does it work within the larger formula by not in a
cell by itself?
Thank you.

Dave


"Mike H" wrote:

hi,

I may have misunderstood but you may not need a macro. Put this in b1
and it will average the last 30 values in that column and update as values
are added to the end of the column. You can adjust the 1000 to suit your
needs. Drag right for other columns

=IF(COUNT(B2:B1000),AVERAGE(B1000:INDEX(B2:B1000,I NDEX(LARGE((B2:B1000<"")*ROW(B2:B1000),31),0))),0 )

Mike