+ Reply to Thread
Results 1 to 15 of 15

Trailing twelve weeks

  1. #1
    Registered User
    Join Date
    07-09-2007
    Location
    Houston
    MS-Off Ver
    2016
    Posts
    60

    Trailing twelve weeks

    I am trying to graph the last 12 weeks of data on a line chart for several locations and am currently going in and manually changing the source data on a weekly basis for 8 graphs with 12 locations per graph. It is pain staking and I feel there should be an easier way to do this but am not sure what it would be. So I am wondering is there a way to set up a graph to pull the last 12 data points on a row?

  2. #2
    Forum Expert oldchippy's Avatar
    Join Date
    02-14-2005
    Location
    Worcester, UK
    MS-Off Ver
    Excel 2007 (Home)
    Posts
    7,097
    Hi,

    You might find something here under dynamic charts

    http://peltiertech.com/Excel/Charts/Dynamics.html
    oldchippy
    -------------


    Blessed are those who can give without remembering and take without forgetting

    If you are happy with the help you have received, please click the <--- STAR icon on the left - Thanks.

    Click here >>> Top Excel links for beginners to Experts

    Forum Rules >>>Please don't forget to read these

  3. #3
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    Suppose the X and Y data are in A2:B34 (headers at top). Then create two named ranges:

    Sheet1!SeriesX Refers to: =OFFSET(Sheet1!$A$1, MATCH(9E+307, OFFSET(Sheet1!$A$1, 1, 0, 65536 - ROW(Sheet1!C3), 1)) -11, 0, 12, 1)

    Sheet1!SeriesY Refers to: =OFFSET(Sheet1!SeriesX, 0, 1)

    Then change the series on the chart to

    =SERIES(,Sheet1!SeriesX,Sheet1!SeriesY,1)

    Now if you add data to the bottom, it will always plot the last 12 values.

  4. #4
    Registered User
    Join Date
    07-09-2007
    Location
    Houston
    MS-Off Ver
    2016
    Posts
    60
    OK guys thank you very much for your help. I have been reading up on this and was about to attempt to do it when I realized I left out one very important detail. We are tracking several different stats for several different locations, some of which we have been charting longer than others. so while series x may have 20 weeks series y may only have 12 and so on and so forth. I am going to attemt to explain how the data is set up.

    in column C we have all of our locations. then across the top we have week0, week1, week2, ect. through week 40 then it starts over again at week0 to track another type of data.

    Like I said we started tracking different locations at different times so each location has a different amount of data.

    What I am guessing I need to do would be to enter a seperate range name for each location and enter that in under series data as oppose to data range on the chart. If this is so it will take a while but will give me practice with Dynamic graphs and will make it easier down the road. Can someone please confirm that this is how I need to do it before I put a lot of time into it.
    Last edited by txbullets; 02-20-2008 at 07:44 PM.

  5. #5
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    Can you dummy up some representative data and post a workbook?

  6. #6
    Registered User
    Join Date
    07-09-2007
    Location
    Houston
    MS-Off Ver
    2016
    Posts
    60
    I am about to head home from work but will try to this evening.

  7. #7
    Registered User
    Join Date
    07-09-2007
    Location
    Houston
    MS-Off Ver
    2016
    Posts
    60
    Ok attached is the file. Any help would be appreciated
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    07-09-2007
    Location
    Houston
    MS-Off Ver
    2016
    Posts
    60
    Is this even possible with the way the table is set up? If not could you suggest a better way to set the table up. In the actual workbook each location has its own tab and that is where this data is pulled from.

  9. #9
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    I think you should rearrange the data in a database (tabular) format. So you would have these columns (at a quick glance):

    Region (a through aq)
    Date of Launch
    Data Type (A/R, Total Orders, Order Entry Errors, Invoice Prep Errors)
    Weeks 1 through 40

    No blank rows.

    Then you can use a pivot table and all sorts of other tools to analyze and plot data.

  10. #10
    Registered User
    Join Date
    07-09-2007
    Location
    Houston
    MS-Off Ver
    2016
    Posts
    60
    I didn't set up this wookbook but I believe the reason behind setting it up this way was so that we could show all A/R information together, and all Invoice error info together, ect. Originally we were only going to track each location for 12 weeks but as you can see that did not happen. We were not seeing the improvement we were looking for. I will play with your suggest though because with a pivot table we could essentually do the same thing. I am not sure how this will help me graph the last 12 weeks of each row though. I am realy starting to think it is not possible.

    The problem is that on the graph the x axis needs to be labeled weeks 0-12 and then for each location we want to graph the last 12 weeks of data. so if location A is on week 14 and location B is on week 20 we would be graphing weeks 2-14 for location A and weeks 8-20 for location B on the same graph.

    I have reattached a file this time I included the Graph tab so you can see how we are currently doing this. The Graphs are a mess because we are tracking too many locations on one graph but we should be clearing a few locations off shortly. The progress tab pulls from each individual locations tab which I go in and also manually update!

    Again thanks for you guys help. If this can not be done just let me know so I will stop thinking about it!!
    Attached Files Attached Files
    Last edited by txbullets; 02-21-2008 at 06:57 PM.

  11. #11
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    It can be done -- not trivially, but with some effort. Putting the data all together as a single table would be a good start.

    Then you can make a second table (on another sheet) where you select the region and type of data, and it computes the range of cells to plot (the last 12 weeks of data) for each series.

    Doing it manually is error-prone, as I expect you've found.

  12. #12
    Registered User
    Join Date
    07-09-2007
    Location
    Houston
    MS-Off Ver
    2016
    Posts
    60
    yes very much so!! It looks like I have a good weekend project. Thank you for the Ideas. I am sure I will run into more questions on this but for now I will try rearranging it like you have suggested and see how that goes. I want to get this as automated as possible so I can prevent mistakes and save time.

  13. #13
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    BTW, the reason for having Total Orders as a data type, is that typically in a database you shouldn't have derived data (percent of stuff), just the raw data.

  14. #14
    Registered User
    Join Date
    07-09-2007
    Location
    Houston
    MS-Off Ver
    2016
    Posts
    60
    Can you please elaberate on the database (tabular) format. I started setting it up with the columns like you suggested but my question is if the weeks still go across the top are you not still stuck with the same problem. Then when I try to run a pivot table on it every week is set as a field. Is there another way to run the pivot table.

    What I have tried doing is setting up another table with an offset function to pull the last 12 weeks. This seems like it will work but why did I need to set it up any different, I could have done the same thing with the table I had. I feel like I am missing something here.

    I have uploaded the new file and included the 12 week tab that I have been working on setting up with the offsets. Can someone let me know if there is a better way to do this before I put too much time into it.

  15. #15
    Registered User
    Join Date
    03-23-2008
    Posts
    16
    Did you ever figure out a resolution for this problem? By looking at your data, I think you can make it work. I am willing to help any way I can.

    I think you want to use Define Names to set up ranges for each location (BPT & COR) and information type (A/R).

+ 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