+ Reply to Thread
Results 1 to 7 of 7

formula to enable plotting aggregated data

  1. #1
    Registered User
    Join Date
    03-31-2009
    Location
    Carmoo, Australia
    MS-Off Ver
    Excel 2000
    Posts
    18

    formula to enable plotting aggregated data

    Excel 2007
    I have a column of 2,500 weekly data points - too many to chart across the page.
    I need a formula to aggregate 4 weeks and put the total in a new column so that the new shorter column can be charted instead.
    There is a heading row.

    Example
    Weekly Monthly
    10 100
    20 260
    30
    40
    50
    60
    70
    80

    To give you a laugh, this is what I tried :
    B2=SUM(A$(((ROW()-2)*4)+2):A$(((ROW()-2)*4)+5))

    Dave

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: formula to enable plotting aggregated data

    You're not a million miles off in truth...

    You could use SUM(INDEX:INDEX), eg:

    B2: =SUM(INDEX(A:A,2+(4*(ROWS($B$2:$B2)-1))):INDEX(A:A,2+(4*(ROWS($B$2:$B2)))-1))

    Or

    B2: =SUM(OFFSET($A$1,1+(4*((ROWS($B$2:$B2)-1))),0,4,1))

    The advantage of the former over the latter is that the former is not Volatile whereas the latter is (OFFSET).

    Given we don't know what it is you're doing it's hard to offer anything more but it might be feasible to use a Pivot Chart and Group the dates ?

  3. #3
    Registered User
    Join Date
    03-31-2009
    Location
    Carmoo, Australia
    MS-Off Ver
    Excel 2000
    Posts
    18

    Re: formula to enable plotting aggregated data

    Thanks for that, I'll go with the OFFSET version.
    I would never have worked that out in a million years.

    Was the first one strictly correct ?

    Dave
    Last edited by DaveKimble; 03-31-2009 at 11:06 PM.

  4. #4
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: formula to enable plotting aggregated data

    Was the first one strictly correct ?
    Not sure I follow...the first function (INDEX:INDEX) should work ok, no ?

    INDEX:INDEX should really be used in preference to OFFSET given the latter's volatility - if your model is not big it's not a huge issue but it's generally advised that you should avoid using Volatile functions wherever/whenever possible... I accept OFFSET may be shorter/easier to follow but not necessarily the best approach in this instance.

  5. #5
    Registered User
    Join Date
    03-31-2009
    Location
    Carmoo, Australia
    MS-Off Ver
    Excel 2000
    Posts
    18

    Re: formula to enable plotting aggregated data

    Its just that the 2 INDEX expressions appear to be the same :
    B2: =SUM(INDEX(A:A,2+(4*(ROWS($B$2:$B2)-1))):INDEX(A:A,2+(4*(ROWS($B$2:$B2)))-1))

    perhaps the second "2+" should read "5+" ?

    Dave

  6. #6
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: formula to enable plotting aggregated data

    The simplest way would be to test... if you look very closely you will find they're not the same (for ex. count the parentheses prior to the -1) ...

  7. #7
    Registered User
    Join Date
    03-31-2009
    Location
    Carmoo, Australia
    MS-Off Ver
    Excel 2000
    Posts
    18

    SOLVED Re: formula to enable plotting aggregated data

    Oh, I see.
    You get a click on the genius icon for that one.
    Many thanks.

    Dave

+ 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