+ Reply to Thread
Results 1 to 10 of 10

copying an aggregate average function down multiple rows

  1. #1
    Registered User
    Join Date
    11-23-2012
    Location
    Boone, NC
    MS-Off Ver
    Excel 2010
    Posts
    2

    Question copying an aggregate average function down multiple rows

    I have 2000 rows of data and I am trying to average it every 12th row. This is the formula that I am entering in the adjacent column; =aggregate(1,4,A1:A12). I will then enter a few more in to start the patter, =aggregate(1,4,A13:A25), etc. I will manually enter about 5 formulas. I want to be able to click and drag that down so that I don't have to enter it in for the 167 rows that it will take to aggregate the 2000. However, when I do that, it does not 'remember' the every 12th pattern and starts over from cell A1. Any ideas? cheers

  2. #2
    Forum Expert dredwolf's Avatar
    Join Date
    10-27-2012
    Location
    Clearwater,Canada
    MS-Off Ver
    Excel 2007
    Posts
    2,649

    Re: copying an aggregate average function down multiple rows

    maybe something like :
    =Aggregate(1,4,offset($A$1,"A"&(Row()-1)*12+1:"A"&Row()*12)

    NOT TESTED, just an idea, and you would obviously have to adjust for the Reference column and starting row..

    Hope this helps
    Last edited by dredwolf; 11-24-2012 at 12:24 AM.
    A picture may be worth a thousand words, BUT, a sample Workbook is worth a thousand screenshots!
    -Add a File - click advanced (next to quick post), scroll to manage attachments, click, select add files, click select files, select file, click upload, when file shows up at bottom left, click done (bottom right), click submit
    -To mark thread Solved- go top of thread,click Thread Tools,click Mark as Solved
    If you received helpful response, please remember to hit the * of that post

  3. #3
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,156

    Re: copying an aggregate average function down multiple rows

    hi sarah.grady, i don't have the AGGREGATE formula in my computer & have never used it before, so i tested with SUM. it should work the same i guess.
    =AGGREGATE(1,4,INDIRECT("A"&1+(ROW(B1)-1)*12&":A"&ROW(B1)*12)))

    the 12th cell from A13 should be A24 right?

    @dredwolf:
    you might be missing the INDIRECT formula

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  4. #4
    Forum Expert Moo the Dog's Avatar
    Join Date
    09-28-2012
    Location
    Wisconsin
    MS-Off Ver
    Office 365 (PC & Mac)
    Posts
    1,845

    Re: copying an aggregate average function down multiple rows

    The best I could come up with is using a helper column to give me the cell locations that I needed. You can see my attached sheet.

    I entered random numbers from A1:A2000

    I then entered 1, 13, 25, 37 in cells C1:C4, selected those cells, then right-clicked and dragged down to row 167 and chose LINEAR FILL. This gives me the starting cell reference for each aggregate function needed for a 2000 row series.

    Then, in B1 I entered: =AGGREGATE(1,4,INDIRECT("A"&C1&":A"&C1+11)) and filled that down to row 167.

    Seems to work, but does use a helper row. Not sure of how to do it otherwise.

    - Moo

    * Benishiryo got it without the helper column. Well done!
    Last edited by Moo the Dog; 11-24-2012 at 12:31 AM.

  5. #5
    Forum Expert Kevin UK's Avatar
    Join Date
    12-07-2010
    Location
    Radstock, Somerset
    MS-Off Ver
    365
    Posts
    1,922

    Re: copying an aggregate average function down multiple rows

    @benishiryo

    Your profile indicates that you have Excel 2010, you should have the AGGREGATE function.

  6. #6
    Registered User
    Join Date
    11-23-2012
    Location
    Boone, NC
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: copying an aggregate average function down multiple rows

    The 2000 rows are data points taken at 5 minute intervals. I am using the aggregate function to try to average them into one hour increments because one hour is the largest interval that we test at. I am entering the following formula into the first three cells; =AGGREGATE(1,4,'Sheet 1'!A1:A12), =AGGREGATE(1,4,'Sheet 1'!A13:A24), =AGGREGATE(1,4,'Sheet 1'!A25:A36). When I highlight and try to drag that formula down, it does not keep the 'every 12' pattern.

    There are other ways to aggregate this data but we are trying to set up a spreadsheet so that anyone will eventually be able to just copy and paste the data into tab 1, and tab 2 will already have the formulas entered so the data will just automatically appear, with no further filtering or sorting required. thanks for all the help!

  7. #7
    Forum Expert dredwolf's Avatar
    Join Date
    10-27-2012
    Location
    Clearwater,Canada
    MS-Off Ver
    Excel 2007
    Posts
    2,649

    Re: copying an aggregate average function down multiple rows

    @benishyro
    you probably right, I came up with the thought just before heading to work, so didn't have time to test it out


  8. #8
    Forum Expert Moo the Dog's Avatar
    Join Date
    09-28-2012
    Location
    Wisconsin
    MS-Off Ver
    Office 365 (PC & Mac)
    Posts
    1,845

    Re: copying an aggregate average function down multiple rows

    I would think that by modifying Benishyro's formula it should work
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    - Moo

    * You can fill that formula down as far as you need to. Once it gets out of range it will return #DIV/0
    Last edited by Moo the Dog; 11-24-2012 at 11:32 AM. Reason: Deleted a closing ) to fix formula

  9. #9
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,730

    Re: copying an aggregate average function down multiple rows

    Not sure why you are using AGGREGATE here, if you are using 4 as the second argument then you aren't ignoring hidden or filtered rows or errors so you could use AVERAGE like this:

    =AVERAGE(OFFSET('Sheet 1'!A$1,(ROWS(C$1:C1)-1)*12,0,12))

    assumes first formula in C1, change as appropriate
    Audere est facere

  10. #10
    Forum Expert Moo the Dog's Avatar
    Join Date
    09-28-2012
    Location
    Wisconsin
    MS-Off Ver
    Office 365 (PC & Mac)
    Posts
    1,845

    Re: copying an aggregate average function down multiple rows

    I wondered the same thing when I saw the 4 as the second argument. Go figure.

    - Moo

    - - - - - - - - - -
    Help someone smile today.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1