Solved

Excel charting - dynamically adjust?

Posted on 2016-08-25
5
31 Views
Last Modified: 2016-08-27
I have a sports season stats spreadsheet.
Basically, I have a Totals sheet which through the magic of the indirect function totals all the data on the corresponding sheets that are included between the sheet labeled "First" and the sheet labeled "Last".
Each game, I simply add a sheet prior to "Last" and it's auto updating my Totals sheet.
This is working very well.

I also have a Trends sheet (outside of the First/Last range) that lists individual data/trends for each athlete.
So, for our last game, I might have a stat totaled using =INDIRECT("'"&O$1&"'!"&"C2").  The column header here is the name of that corresponding sheet, allowing it to grab cell C2 from that sheet.

Okay, so all of this works fine, until I want to update my charts.  I have trendline for all athletes and for the team as a whole.
Each week that we have a game, I have to go into all 13 charts and update the data reference to include the new columns, which point to the new sheets.  Is there a way that the charts can be updated to dynamically include charting source as new columns are added, much like what I'm doing with the totals sheets (but for charts)?
0
Comment
Question by:sirbounty
  • 3
5 Comments
 
LVL 27

Accepted Solution

by:
Glenn Ray earned 500 total points
ID: 41771188
You should be able to create a dynamic range name using OFFSET to define the horizontal axis of your chart so that it will automatically update.  The trick will be to create a much larger data set to include future placeholder values that - while returning no results now (#N/A), will be picked up when new sheets are added.

For example, if your current horizontal axis is defined in a row, say cells A1:L1 (12 columns), you could create a dynamic range called "xaxis" with the formula
=OFFSET(Sheet1!$A$1,0,0,1,COUNTA(Sheet1!$A$1:$L$1))

Columns A:AZ gives you 52 columns to check, but the range will only apply to the ones with values in them, even if they are formula-driven.

You would then reference that range name in your chart.
=sheetname!xaxis

Likewise, you'll replace your current data range with a dynamic range name so that only valid categories are shown.  Same method as above with xaxis.  If the values are in say, row 12, the range name would have this formula
=OFFSET(Sheet1!$A$12,0,0,1,COUNTA(Sheet1!$A$1:$L$1))

I've attached an example workbook.  I have twelve monthly data sheets and a "Chart" sheet that uses INDIRECT to pull and transpose data.  Note that only ten months are shown on the "Chart" sheet.  If you manually add "Nov" and/or "Dec" to the colored cells (K1 and L1), the chart will automatically update and re-scale.

Regards,
-Glenn
ee-DynamicChartAxis.xlsx
0
 
LVL 47

Expert Comment

by:Wayne Taylor (webtubbs)
ID: 41771190
Hi Neal! Feels like back in the good old days seeing your name :)

If you have the dynamic ranges already for your Totals sheet, you should be able to make use of them in your charts. Can you post a dummy worksheet? Or even an example of one of your chart series ranges?

Wayne
0
 
LVL 67

Author Comment

by:sirbounty
ID: 41771540
Hi Glenn - I think that's exactly what I'm looking for, but my charting skills are limited to what Excel does for me (well, maybe a bit beyond that, but not much!).

This is my chart data range currently (even though my data doesn't yet extend through col V - so I have blank data in my chart, which I want to avoid, which also appears is what you're solving above)
=Trends!$B$1,Trends!$D$1:$V$1,Trends!$B$6,Trends!$D$6:$V$6,Trends!$B$10,Trends!$D$10:$V$10,Trends!$B$13,Trends!$D$13:$V$13,Trends!$B$16,Trends!$D$16:$V$16

My axis label is simply =Trends!$D$1:$V$1 (again, actual data only goes through col R - but we have a big tournament tomorrow)
0
 
LVL 67

Author Comment

by:sirbounty
ID: 41771542
Hi Wayne - hope you're doing well!  Reminds me of the good ol' days - haha. :^)
0
 
LVL 67

Author Closing Comment

by:sirbounty
ID: 41772865
Took me a bit to track with what I needed to do, but once I did, it started to make sense.  Great solution - thanks much!
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Drop Down List with Unique/Distinct Values (enhancing the Combo-Box with a few steps and a little code) David miller (dlmille) Intro Have you ever created a data validation list from a database field or spreadsheet column (e.g., Zip Codes or Co…
Workbook link problems after copying tabs to a new workbook? David Miller (dlmille) Intro Have you either copied sheets to a new workbook, and after having saved and opened that workbook, you find that there are links back to the original sou…
The viewer will learn how to simulate a series of sales calls dependent on a single skill level and learn how to simulate a series of sales calls dependent on two skill levels. Simulating Independent Sales Calls: Enter .75 into cell C2 – “skill leve…
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now