View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
Mike H Mike H is offline
external usenet poster
 
Posts: 11,501
Default automatically average the last 4 columns

Ah,

I misread your post but it still doesn't need to be a macro

=AVERAGE(OFFSET(INDEX(Sheet2!5:5,,COUNT(Sheet2!5:5 )),,-4,1,5))

Mike

"Mike H" wrote:

Hi,

No it doesn't need to be a macro, try this

=AVERAGE(INDIRECT("sheet2!A"&MATCH(6.0222*10^23,Sh eet2!A:A)&":E"&MATCH(6.0222*10^23,Sheet2!A:A)))

Mike

"Greg" wrote:

I am trying to figure out how to automatically average the last 4 columns in
a worksheet that every week adds a column. In other words, for "Prior4Weeks"
on Sheet1, the formula would be =AVERAGE('Sheet2'!A5:D5)

But then, a week later with another week's data summarized in a column added
to Sheet2, the formula should read be =AVERAGE('Sheet2'!B5:E5)

I know it's gotta be a macro, but don't know where to start.

TIA,

Greg