+ Reply to Thread
Results 1 to 2 of 2

Macro/formula ideas for chart that pulls up only last 12 months of info?

Hybrid View

  1. #1
    Registered User
    Join Date
    06-23-2009
    Location
    Berkeley, CA
    MS-Off Ver
    Excel 2003
    Posts
    3

    Macro/formula ideas for chart that pulls up only last 12 months of info?

    I'm working on a bar graph chart that accumulates data from the last 12 months of information (each month is a distinct data point). Every month, I'm supposed to extend the sum to the most recent data point and subtract the oldest data point from the total (since "12 months ago" now would become "13 months ago" and outside the scope). Is there a formula or macro I could use to automatically tell Excel to always some up the 12 most recent data points? Thanks!

  2. #2
    Forum Contributor
    Join Date
    04-01-2009
    Location
    Irvine, CA
    MS-Off Ver
    Excel 2010
    Posts
    280

    Re: Macro/formula ideas for chart that pulls up only last 12 months of info?

    You can use named ranges with the OFFSET function to limit you to the last 12 data points.

    For example, you can define a name as xVal
    =OFFSET('Sheet1!$B$3,0,COUNTA('Sheet1!$B$3:$IV$3)-12,1,12)
    And then use Sheet1!xVal as the x-axis of the chart.

    You would need a different named range for each series and each label (if it is moving).

    The example OFFSET is for adding a new column of data.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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