Inserting Named Ranges into Formulas

  • Hi,


    I am wanting to build a macro to calculate the average of a range of cells. I have about 2000 lines of data, and I want to average the first 12 cells (then paste the answer somewhere else), then average the next 12 cells, and so on. Using a loop to do this is simple enough. My problem is that I can't insert variables into the average formula as the cells to be averaged



    Thank you in advance
    Jac

  • Re: Inserting Named Ranges into Formulas


    Hi,


    If you prefer a formula based approach, then try,


    In A5 and copy down,


    =AVERAGE(INDEX('[NP FT01-03 010206]NP - FT01'!A$5:A$171,ROWS($A$5:A5)*12-12+1):INDEX('[NP FT01-03 010206]NP - FT01'!A$5:A$171,ROWS($A$5:A5)*12))


    HTH

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!