View Single Post
  #9   Report Post  
Posted to microsoft.public.excel.newusers
Domenic
 
Posts: n/a
Default average last 17 cells (variable)

Try...

=AVERAGE(INDEX(C3:IV3,LARGE(IF(C3:IV3<"",COLUMN(C 3:IV3)-COLUMN(C3)+1),A1
)):INDEX(C3:IV3,MATCH(9.99999999999999E+307,C3:IV3 )))

....confirmed with CONTROL+SHIFT+ENTER, not just ENTER.

Hope this helps!

In article <5775c4b057cda@uwe,
"Brian Thompson via OfficeKB.com" <u15682@uwe wrote:

I am working out the average hrs of employees for the WTD (Working time
directive). Currently attempting to work out the last 17 weeks, however,
later this may turn to be 26 weeks if "Opt out" is agreed.

Cell A1 = number of last weeks to average, ignoring blanks cells
Cell A3 = Name
Cell B3 = Result of last 17 weeks
Cell C3 = Hrs
Cell D3 = Hrs
Cell E3 = Hrs
Etc, Etc

If it is not possible to enter a variable in A1, then I will go with the
fixed 17 weeks

Hope this is clearer?

Regards

Brian