I am trying to build a chart which dynamically updates the series' selected based on user-defined selections from a drop-down menu.
Purpose is to create chart which displays n-series of data based on n-selections, e.g.
=Output!$P$36:OFFSET(Output!$O$35,IF(Output!$C$4="RANK",COUNT(Output!$S$34:$S$38),COUNT(Output!$S$34:$S$38)+3),COUNTA(Output!$P$35:$W$35))
The named range dynamically updates the chart area (i.e. row labels, column labels and data range). I reference it correctly i.e. as ='filename.xlsm'!named_range_here in the "Chart Data Range" section.
When I do this, the Chart Data Range resets itself [help]
How can I tell excel to stop showing blank series (e.g. 2 blank series of 5 when i want it to display the 3 series which have values) [ideas please]
When you apply a Name to the entire chart source data range, it is converted into its address. To keep dynamic Names, you need to define a Name for each distinct X and Y value range, and insert these into the respective series formulas.
If you're not shy about VBA, you can still make it work, following the approach in my tutorial Dynamic Chart Source Data.
Related
I have been trying to dynamically change the range of a stacked bar chart to adapt to different selections of three option buttons. My table is arranged from J1:M14. The top line contains the headers for each column. The first column (J) contains a descriptive column. The actual data is contained between columns K and M. One selection of the option button results in the range of the data expanding to J1:M15. So, based on the option button selection, the number of rows in this table increase, but the number of columns remains fixed.
I want to create a stacked bar chart that displays each of the stacked bars for each descriptive label in column J. With a different selection of the option button, the stacked bar chart will either extend to include the extra label, shrink to remove the extra label, or keep the same length.
What is happening: The range is fixed and will not change. When I select the option button, the range does not shift based on the data range.
What I have tried: Under formulas-->Name Manager, I have created four new names:
1.) DatainColumnK: =OFFSET(Calculations!$K$2,,,COUNTIF(Calculations!$K$2:$K$100,"<>"))
2.) DatainColumnL: =OFFSET(Calculations!$L$2,,,COUNTIF(Calculations!$L$2:$L$100,"<>"))
3.) DatainColumnM: =OFFSET(Calculations!$M$2,,,COUNTIF(Calculations!$M$2:$M$100,"<>"))
4.) DescLabelColJ: =OFFSET(Calculations!$J$2,,,COUNTIF(Calculations!$J$2:$J$100,"<>"))
Next, I selected the entire range of the data --> Created a stacked bar chart --> Clicked Select data --> Added three new series in the Legend Entries by editing series and only entering in TabName!DatainColK, TabName!DatainColL, TabName!DatainColM and then editing the axis labels by adding in TabName!DescLabelColJ.
Is there something I'm missing?
I was looking for a similar problems, but couldn't find an answer to this issue. I have a huge blank space on the side of my graph.
I cant change the axis setting because my graph auto updates when new data is entered. I have also cleaned the table, so there is no empty data in the table.
my graph
That means your Axis labels or Series values are derived by a formula. In order to deal with the scenario, create two dynamic named ranges and use them as series for the chart.
Assuming your axis labels are in column B, create a named range using the formula given below...
=OFFSET(Sheet1!$B$2,,,COUNTIF(Sheet1!$B:$B,"?*")-1)
Same way create another named range to hold the series values.
And then right click the chart --> choose Select Data --> select the series and the axis label one by one --> Edit --> And in the series values or in the axis label range, use the relevant named range using the formula given below..
Sheet1!YourNameRangeForAxisLabel
Sheet1!YourNameRangeForSeriesValues
Here Sheet1 is the sheet which the named ranges belong to.
Later this would be changed automatically and reflect the workbook reference correctly.
I have a chart in Excel 2010, and I want to have a data series that can refer to multiple named ranges based on criteria in another cell. For example, if A1 = 1, the data series will display the data from S_1, and if A1 = 2 it will display the data from X_1. Both S_1 and X_1 are dynamic, and can refer to different data based on other conditions I have.
I've gone into the select data source of the chart, and tried setting the series value of the data series equal to formulas like IF(A1 = 1, S_1, X_1), and CHOOSE(A1,S_1,X_1), but it says these functions aren't valid.
Is the syntax of the formula off, or does excel not accept these formulas in its series value? If it's the latter, what other way is there to achieve the desired result?
I would use another column (could be hidden) to extract the specific data I want to plot.
First, you'll need a list, or some other way to interpret the number in A1 to the specific series you want to show. Than you create a column (for simplicity I assume it is aligned with your data) that fetch the relevant data from the table, and set the chart on it.
Now, step by step:
Define the mapping between the number in A1 and the data series you want to choose. I'll use it as the column number of the data.
Define all the data range as a named range, say data.
Take a new column, and paste this formula in row 1:=INDEX(data,1,$A$1), This will bring the header.
In the cell below type: =IF(ISBLANK(INDEX(data,0,$A$1)),NA(),INDEX(data,0,$A$1)) to bring the data from the relevant series, or #N/A if it's blank.
Drag the 2nd formula all the way down to the lowest row in which any of the series has data in it.
Create a chart based on the new column, and watch how you can chang the value in A1 and see the chart updates.
Tell me if it answers your question ;)
I have already made charts and would like to make it dynamic so that when I add new data (highlighted yellow) the charts will update automatically.
Can someone guide me on how to do this.
Image of sample data for what I am trying to do is attached.
I would advise the use of named formulas for your series data inputs. Your named formulas can be dynamic in nature, in that they search across the row and check for the first blank row of data.
As an example, all the grapsh can have their horizontal axis labels set to the named formula 'validDates', where
validDates is put in the name manager as :
='NTesco'!$C$2:INDEX('NTesco'!$2:$2, MIN(IF('NTesco'!$B$3:$AZZ$3="", COLUMN('NTesco'!$B$3:$AZZ$3), 99999)))
N.B. You could use slightly different variations for each graphs date range if there will be independent data gathering for each corresponding value range. Then you should use that row's row index in the IF logical test argument...
You could also use a formula for the first graph values, such as:
='NTesco'!$C$3:INDEX('NTesco'!$3:$3, MIN(IF('NTesco'!$B$3:$AZZ$3="", COLUMN('NTesco'!$B$3:$AZZ$3), 99999)))
The AIOWHB graph takes values from the 4th row, so would be:
='NTesco'!$C$4:INDEX('NTesco'!$4:$4, MIN(IF('NTesco'!$B$4:$AZZ$4="", COLUMN('NTesco'!$B$4:$AZZ$4), 99999)))
And so on for the other two....
In MS Excel if we want to make a chart then we have to select the data range.
Is there is any way that when new entries (row or column) are added then the chart updates automatically?
I've found this to be challenging for stacked bar charts in Excel 2010. Let's take the case of a simple table with some numbers:
2016 2017
Sam 3 4
Fred 5 6
Alice 3 4
Select the table, right-click on its tab, and select insert chart. Choose stacked bar. Then, choose switch Row/Column. Now, if you go to Design | Select Data, you see a nice formula for the Chart Data Range. If you insert a row, however, and add someone else, you get a discontinuous range and they are not included in the chart. If, however, you first select your data, choose Insert | Table, and tell it it has headers, then you can insert a row, and have it included in the chart automatically as e.g. sales from an extra salesperson.
This happens only if two things occur:
It must be a table, and
It must be a continuous table range for your source data. No skipping columns. Perhaps it might work for a subset of a table.
If either is not true, it breaks it. I would criticize the way it doesn't account for inserted rows, or the way it complains about chart data ranges being too complex and doesn't even show you the text of the chart data to let you edit it, if the columns are out of order (ok, I'm complaining), but while e.g. Libre Office calc lets you edit formulas even when they are complex, it never keeps track of inserted rows to add more data series.
If you use dynamic formulas for the chart, or named regions, it just converts them into cell range references, and fails to account for inserted rows.
Create dynamic named ranges for the labels and each series, and edit the chart data to use these names.
An example for the named range is where the labels might be in column A, and some values in column B
=$B$2:INDEX($B:$B,COUNTA($A:$A))
which is defining a range starting at B2 and ending at the row in column B that corresponds to the last data row in the labels column A.
Add a named range for each series.
When pointing the chart to these names, be sure to preface it with the sheet name, even if you are on that sheet, something like
=Sheet1!2010Amounts