+ Reply to Thread
Results 1 to 16 of 16

Streamlining a series of charts with ever changing data ranges?

Hybrid View

  1. #1
    Registered User
    Join Date
    08-01-2017
    Location
    NH, USA
    MS-Off Ver
    2016
    Posts
    10

    Streamlining a series of charts with ever changing data ranges?

    I have a series of charts whose data series add a number of rows every year. I would like to come up with a way that I could update all charts by changing one value, once. The number of rows of data that are added each year varies, but is always the same for all charts in the given year. The way I update them currently is to go to the first chart, select the data series and change the end cell (i.e. from A100 to A173), then I go to the next chart, select the data series and change B100 to B173, so on and so forth, for all 50+ charts. I could give each range a name and just update the range in the Name Manager instead, but I would still be doing that for the 50+ named ranges. I thought maybe I could make a separate sheet with two cells named "start" and "end", in which I would put the start and end row values and then in the chart set the start and end of the data series to SHEET1!A"start":A"end"........SHEET!B"start":B"end", but that doesn't want to work either. Is there some way I can do this?
    TIA
    Brett

  2. #2
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Streamlining a series of charts with ever changing data ranges?

    Sounds like you want to work with dynamic named ranges. See here...

    http://www.contextures.com/xlNames01.html#Dynamic

    Once you have those, then you place the named range into your series instead of a set range. Note: You must include the sheet name along with the defined name (i.e. sheet1!Bob)
    Attached Images Attached Images
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Registered User
    Join Date
    08-01-2017
    Location
    NH, USA
    MS-Off Ver
    2016
    Posts
    10

    Re: Streamlining a series of charts with ever changing data ranges?

    If I see how this works properly, I would still have to setup and change every year the 50+ dynamic ranges?
    What would really help is if I could have a cell named "end row#", which I could change every year and have the series formulas for each chart set up like
    =SERIES('SHEET1'!$K$5,DATA!$A$558:$A${end row#},DATA!$C$558:$C${end row#},5)...........for the next chart the formula would have D instead of C, and so on.
    Then all I would have to do is change the "end row#" and all charts would be updated.

    Maybe without the named cell, it would be something like,
    =SERIES('SHEET1'!$K$5,DATA!$A$558:$A${=value(SHEET0!$A$1)},DATA!$C$558:$C${=value(SHEET0!$A$1)},5).....where SHEET0!A1 is the cell with end row# in it.

    It seems like it should be simple, but I can't figure out the syntax to make it work?
    BTW, there is also a data series in each chart that takes the next 4 values after the end row#......so the start row# and end row# for those change every year.

    I can make a cell to concatenate "C",end row#, but i still need the code to get that cell contents into the XXXXXXX in the series formula DATA!$C$558:XXXXXXXX.

    I'm sorry if I'm not expressing the situation properly, but this is all new to me and it seems like something that should be very easy.
    Thanks.

  4. #4
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Streamlining a series of charts with ever changing data ranges?

    I don't believe it can be done the way you are suggesting. I'll play around with it.

    Once you set up a series name, it automatically updates whenever you add data. I am attaching a simple example.

    I set up "Bob" as the first series
    =OFFSET(Sheet1!$B$2,0,0,1, COUNT(Sheet1!$2:$2))

    MyDate is then
    =OFFSET(Bob,-1,0)

    Mary is
    =OFFSET(Bob, 1,0)

    Larry is
    =OFFSET(Bob, 2,0)
    and so on.
    As you add data to Bob's row, the graph will add it automatically.
    Attached Files Attached Files
    Last edited by ChemistB; 08-01-2017 at 12:49 PM.

  5. #5
    Registered User
    Join Date
    08-01-2017
    Location
    NH, USA
    MS-Off Ver
    2016
    Posts
    10

    Re: Streamlining a series of charts with ever changing data ranges?

    ChemistB,
    Ok, I'm learning by editing things in your sheet. I add a column for Oct and add data below it, nothing happens to the charts until I click Calculate Now and then they are updated. I'm not sure what the $2:$2 values are for in the COUNT routine? I understand that it makes excel count the number of cells in the 2nd row that have a value in them, but is it actually saying to count all cells with values from Row2 to Row2?

    My second question pertains to omitting the first column or two with data. In the series BOB, I changed $B$2 to $C$2 and now when I hit Calculate Now, the Jan values are dropped from all charts, but because the COUNT still sees 10 cells with values in Row2, it starts from C and goes to L, which has no data in it. How do I have it COUNT Row2 starting from Column3, instead of Column2?
    Thx,
    Brett

    Also, I have random cells for each data set that have empty cells, so it may be that COUNT would actually result in different numbers if ran on all data sets. Will this wreak havoc with the charts?
    Last edited by bbeliveau; 08-01-2017 at 02:13 PM.

  6. #6
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Streamlining a series of charts with ever changing data ranges?

    Let's start with your final question. Yes, that will cause havoc with the charts. Not to worry, we can use a different method rather than COUNT. It might be easier if you uploaded an example of how your data would be set up so my example closely match what you really want to do instead of trying to interpret and modify everything.

    Q1. Yes, it is saying to count all the numbers in row 2 assumes that every cell has a number in it. The COUNT($2:$2) is nested within the OFFSET function in the 5th argument which dictates how wide (how many columns) the range will be. Sounds like your sheet is set up for "Manual Calculation" If you want things to update automatically, Formulas Tab on ribbon > "Calculation Options"> "Automatic"

    Q2: How do I set the formula to start from column 3 instead of 2. Change
    =OFFSET(Sheet1!$B$2,0,0,1, COUNT(Sheet1!$2:$2))
    to
    =OFFSET(Sheet1!$C$2,0,0,1, COUNT(Sheet1!$2:$2))
    or
    =OFFSET(Sheet1!$B$2,0,1,1, COUNT(Sheet1!$2:$2))

    To upload an example spreadsheet. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.

  7. #7
    Registered User
    Join Date
    08-01-2017
    Location
    NH, USA
    MS-Off Ver
    2016
    Posts
    10

    Re: Streamlining a series of charts with ever changing data ranges?

    OK, I'm trying to upload a small part of the spreadsheet,you'll see a glimpse of the monster I inherited. I'm trying to have everything build off of the Fixed tab, which contains all needed data.
    I'm confident that I can do that without a problem. The problem is updating the series ranges for each chart every year, as I mentioned, in the complete spreadsheet there are 50+ charts. The "pre"
    data will not change. The "current" data will be the 4 added/"newest" points every year, and the "post" data end will change to include last year's current data.
    Attached Files Attached Files

  8. #8
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Streamlining a series of charts with ever changing data ranges?

    Okay, so you will be adding data down the columns. It looks like the best column to base your dynamic range on would be Column B which has your date. Looks like you add dates as you add data. It doesn't look like you skip any rows in the date column. Is that true?
    If so, set MyDate = OFFSET(Fixed!$B$3, 0,0, COUNT($B:$B),1)

    BW05T (can't have spaces or dashes in defined names) is offset 6 columns so
    =OFFSET(MyDate,0,6)
    Note: also can't have a defined name which is the same as a cell name and, for example BW05, so maybe start those named with an underscore _BW05
    =OFFSET(MyDate,0,5)

    I then created some charts on the Fixed sheet (at about row 650) for BW-05 and BW-05T) using the technique I described in Post #2.
    Select the chart, then go to the Design Tab and > Select Data. Insert the dynamic names as shown in Post 2.
    Questions?
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    08-01-2017
    Location
    NH, USA
    MS-Off Ver
    2016
    Posts
    10

    Re: Streamlining a series of charts with ever changing data ranges?

    Thx ChemistB, it will definitely work for those sets of data. I'll have to figure out how to change that up a bit to handle the 2 data sets for the scatter plots that don't use the entire range, only portions.
    I still wish there was a way for me to assign A1="pre start", A2="pre end", B1="post start", B2="post end", C1="current start" and C2="current end" and then modify the series formula to...
    =SERIES('BW-5_Stats'!$K$5,'BW-5_Stats'!$A$"pre start":$A$"pre end,'BW-5_Stats'!$C$"pre start":$C$"pre end",5) and the same for "post" and "current". That way I could just update those
    6 cell values each year and the 50+ charts would be updated automatically...........wishing someone from microsoft would see this and make it possible.....

  10. #10
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Streamlining a series of charts with ever changing data ranges?

    There are all sorts of ways to come up with dynamic named ranges.

    Let's say that you only want the last 100 data points so if you add 5 data points to the end, 5 data points drop off the beginning. You'd use this formula

    MyDate = OFFSET(Fixed!$B$3, COUNT($B:$B)-100,0, COUNT($B:$B),1)

    Lets' say you don't want to start until some indefinite point where the data begins, for example in Col H, we want to start at H672 and end at H6172 (last number)

    BW05T =INDEX($H:$H, MATCH(TRUE, ISNUMBER($H:$H),0)):INDEX($H:$H, MATCH(9E+99, $H:$H))

    Is there a logical reason why you want to start at point A and end at point B (first number/last number, this year/last year, etc.")?
    If there is no logic to your madness (arbitrarily picking this is a good point to start or end), then we can go with defined names that refer to specific cells but that will use INDIRECT and might use up a lot of memory and slow your system down. (Even my formulas may end up slowing down the calculations with 50 different series).

  11. #11
    Registered User
    Join Date
    08-01-2017
    Location
    NH, USA
    MS-Off Ver
    2016
    Posts
    10

    Re: Streamlining a series of charts with ever changing data ranges?

    The first and second sets of data have a boundary because because processes changed and there needs to be a comparison of values between the two, the third set is just to highlight the current monitoring period which is detailed in the accompanying report. These data sets are only used for the scatter plots.
    I am updating the 28 charts with your formulas now because they use the whole range of data. I'll see if that slows things down, shouldn't with my new comp and 32GB RAM.
    Thanks for all of your help!!!

  12. #12
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Streamlining a series of charts with ever changing data ranges?

    If you do need to create series containing special beginning and end points, say Column L putting beginning row in N1 and end row in M1

    NewRng =INDIRECT("Fixed!$L" & N1 & ":$L" & M1)

  13. #13
    Registered User
    Join Date
    08-01-2017
    Location
    NH, USA
    MS-Off Ver
    2016
    Posts
    10

    Re: Streamlining a series of charts with ever changing data ranges?

    I tried that in the very beginning, but it won't lock in the cells I tell it to look in for the values. I've also tried DIRECT and various combinations of the two along with concatenate. Concatenate makes the text string that I want to put in the name as the range, but it is not recognized as a range, just text?

  14. #14
    Registered User
    Join Date
    08-01-2017
    Location
    NH, USA
    MS-Off Ver
    2016
    Posts
    10

    Re: Streamlining a series of charts with ever changing data ranges?

    OK, that finally worked, but first I had to delete all the #N/A's out of the columns and I could not change the series formula by putting this into the formula bar, I had to actually go to Select Data-choose the data set and type this in, including the workbook name. Oh and I had to lock the cells (F4) in the formula.
    Again, thanks so much, you pointed me in the right direction and it just took some trial/error on my part to figure out how to make it work for me!!!

  15. #15
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Streamlining a series of charts with ever changing data ranges?

    Glad to help. Please go to post #1 and choose "Thread tools" > Mark as solved.

  16. #16
    Registered User
    Join Date
    08-01-2017
    Location
    NH, USA
    MS-Off Ver
    2016
    Posts
    10

    Re: Streamlining a series of charts with ever changing data ranges?

    Do you think there is anyway that I could use a "name" to update all the charts that have a date X axis to all go to the same end date, which changes every year (the beginning date stays constant)? In the X axis bounds, it appears to only accept dates?

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Dynamic Charts, Variable Ranges, Non-Consecutive Data Series
    By 5150 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-23-2014, 10:50 AM
  2. Replies: 1
    Last Post: 04-24-2014, 04:15 PM
  3. Changing the series order for charts
    By fath in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 12-13-2012, 03:57 AM
  4. Changing graph-series length on many charts
    By Leia in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-12-2011, 08:20 AM
  5. Changing automatic value of the y axis on a series of charts
    By Joeschmo5 in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 06-08-2009, 08:19 AM
  6. Replies: 0
    Last Post: 12-09-2008, 08:42 PM

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