## How to create a dynamic chart (excel 2003 and 2007)

**Question:** How do I create a chart that dynamically adds the values, as i type them in the workbook?

**Answer:** Excel 2007 (and later versions) users, create **an excel defined table**. Excel 2003 (and earlier versions) users, create a **dynamic named range**. See links below. They are all links to this webpage and helps you to navigate this page.

Excel 2003 - Dynamic named range - Dynamic chart

Excel 2007 - Excel defined table - Dynamic chart

What you can't do with an excel defined table is to graph for example only the most recent 12 months data. Here you need to rely on **named ranges **in both excel 2003 and 2007.

Make a dynamic chart for the most recent 12 months data

### Excel 2003 - Dynamic named range -> Dynamic chart

This animated picture demonstrates how a dynamic named range automatically adds new values to the excel chart, as they are typed.

Let´s say you created this basic chart below. Now you need to setup named ranges, they expand automatically whenever new data is added.

**Excel 2003 instructions:**

- From the menu bar, click on "Insert"
- From the drop-down menu select "Name"
- Click Define
- Name it "months"
- In "Refers to:" text box, type =OFFSET(Sheet1!$A$1,0,0,COUNTA(Sheet1!$A:$A),1)
- Click OK

Repeat above steps and create a named range named "numbers". Use this named range formula:

=OFFSET(Sheet1!$B$1,0,0,COUNTA(Sheet1!$A:$A),1)

The named range formula is made assuming your data begins in cell A1 and that there are no headers.

**Create a chart**

- From the menu bar, click Insert and Chart
- Select a column chart
- Click Next
- Go to Series tab
- Add a series
- Type in values: =Sheet1!months
- Add another series
- Type in values: =Sheet1!numbers
- Click Finish

### Make a dynamic chart for the most recent 12 months data

The following instructions are made in excel 2007. If you are an excel 2003 user, first read excel 2003 instructions above to understand how to create named ranges in excel 2003.

**Create two named ranges**

- Go to tab "Formulas"
- Click "Define name"
- Name it "recentmonths"
- Type "=OFFSET('recent 12 months'!$A$1,COUNTA('recent 12 months'!$A:$A)-12,0,12)" in "Refers to:"
- Click ok!
- Click "Define name"
- Name it "recentvalues"
- Type "=OFFSET('recent 12 months'!$B$1,COUNTA('recent 12 months'!$A:$A)-12,0,12) " in "Refers to:"
- Click ok!

**Insert chart**

- Go to tab "Insert"
- Click "Column chart" button
- Click "Clustered column chart" button
- Right click on empty chart

- Click "Select Data..."
- Click "Add" button
- Type in "Series values:" =Sheet1!recentmonths

- Click OK

Repeat above steps and add a new series using the named range =*'recent 12 months'!recentvalues*.

**Change horizontal axis labels**

### Excel 2007 - Dynamic chart

**Create an excel defined table**

- Select A1:B3
- Click "Insert" tab
- Click "Table" button
- Click OK!

**Create a chart**

- Select table
- Click "Insert" tab
- Click "Column chart" button

It is now possible to add more rows and columns to the table. The chart is instantly updated!

**How to remove rows / columns**

- Right click on a cell
- Click "Delete"
- Click "Table Rows" or "Table Columns"

You can also "hide" rows or columns and corresponding values in the chart are temporarily removed until you unhide those rows or columns again. Here is a post I did about how to hide columns using vba:

### Download excel sample file for this tutorial.

Dynamic-chartv2.xlsx

(Excel 2007 Workbook *.xlsx)

### Functions in this article:

**OFFSET(**reference, rows, cols, [height], [width]**)**

Returns a reference to a range that is a given number of rows and columns from a given reference

**COUNTA(**value1, [value2]**, )
**Counts the number of cells in a range that are not empty

### 158 Responses to “How to create a dynamic chart (excel 2003 and 2007)”

### Leave a Reply

**How to add vba code to your comment:**

[vb 1="vbnet" language=","]

your code

[/vb]

**How to add a picture to your comment:**

Upload picture to postimage.org

Add picture link to comment.

**How to upload a file**

Upload file

Thanks a lot for this illustrative and easy way to do a dynamic chart. Really helped me a lot!

Hi

This is great if your data (rows or columns) is increasing in size. However, doesn't seem to work if you reduce the number of columns, the graph still displays blanks for the 'missing' data

Can you help?

Excel seems to not let me enter the new series equation in the formula bar. I can type it, but pressing enter or the check mark doesn't do anything. If I do it from "Select chart data", it determines the initial state and then uses that cell reference from then on.

For example, "=SERIES(,O!OpDescriptions,O!CycleTimeValues,1)" would become "=SERIES(,O!$C$2:$C$12,O!$E$2:$E$12,1)" after initial entry. Any ideas?

erik,

change it manually via "Select Chart Data", series by series.

changing it via formula bar wont work (testd on Excel 2007).

The reason cutting and pasting doesn't work is that his examples have commas, and instead it should be semicolon (;). In the description of the functions, in fact, he uses semicolons. If you substitute commas with semicolons it works. Thank you for this tutorial!

giulia tonelli,

It has to do with regional settings. I use ; but most of my readers are americans and they use ,. That is why I use , on this blog.

I know david's post was a while back, but I really appreciate your post. I have the same problem Erik listed. I've spent hours trying to resolve - updates, etc. Using "Select Data" worked. Thanks for the article and allowing the comments.

Marvin,

You are welcome!

If you have your data in a table, you don't need to use the OFFSET function or defined name ranges (Excel 2007 only)

How do you edit the data if you have multiple series? I do not want to edit each one manually.

if there are two or more blank rows? as shown the following

janurary 5

feburary 4

march 6

apr 2

july 7

aug 8

zhen qin,

I am not sure what you are trying to accomplish. If you want two or more blank nonexisting bars in your chart, try changing the named ranges to:

Named RangesMonth:=OFFSET(Sheet1!$A$1, 0, 0, MATCH(9,9999E+307, Sheet1!$B:$B))Numbers:=OFFSET(Sheet1!$B$1, 0, 0, MATCH(9,9999E+307, Sheet1!$B:$B))Where exactly do i find the chart bar. I am working in EXCEL 2007 and I don't see that.

Keith,

Thanks for asking, I have added pictures to this post.

This was a big help.

Thanks!!

tina

Tina,

I appreciate your comment! :-)

Thanks!

Help! What if my data range includes a set of "IF" formulae that sit blank until other datasets are completed elsewhere, (i.e. i have 20 rows, but currently only 5 have data, but the others are formulaed and the data will appear as data is added elsewhere). It appears that the dynamic graph still considers them as values and includes them?!

(btw, otherwise thanks for this - really useful!)

James,

Named range

MonthNamed range

NumberYou, my friend, are a legend. Many thanks!

Thanks a ton !

James and Neha,

You are most welcome!

Oscar,

I am trying to implement your response to James's question as I am working on the exact same problem. When I use the below;

=OFFSET(Sheet1!$B$1,0,0,SUM(--(Sheet1!$B$1:$B$20"")))

I get an error. "A formula in this worksheet contains an one or more invalid references"

Your insights are greatly appreciated

Thanks

CM

CM,

Maybe this example file is helpful:

Dynamic-chart-IF.xlsx

Excel 2007 *.xlsx

Oscar,

Thanks for the prompt response. I should have mentioned that I am trying to create a line chart. And if I have a month populated but not the number the line drops to the x axis which I am trying to avoid. This is a multi series chart. Any thoughts?

Thanks

CM

CM,

And if I have a month populated but not the number the line drops to the x axis which I am trying to avoid.Strange, the line doesn´t drop here. What formula is shown when you click on a chart line?

Hi

Thanks for this, it's just what I needed, however I need to take it a step further.

If looking at your example, my 'Numbers' are created from an If Statement. entering "" for blank cells. Excel doesn't seem to recognise this as an empty cell and thus plots it on the graph anyway.

Do you know of a way I can use get the chart to exclude these items?

Many thanks in advance

MK

MK,

Create a table.

Click black arrow on column header.

Deselect blanks.

Download excel 2007 *.xlsx file

MK.xlsx

Hi Oscar

Thank you very much. This has made my charts a thing of joy!

MK

Hello Oscar,

Using your example above, how would the "define name" functions/formulas change if I wanted to remove one data point for every one I add? (i.e. right after I add "April" to the data series, not only would I like "April" to automatically be added to the graph but also for "January" to be removed).

Thanks for your time!!!

Philip,

Named Range - Month

Named Range - Numbers

Download excel *.xlsx file

Dynamic-chart-dynamic-range.xlsx

Dear Oscar,

Many thanks for the interesting site!

Please could you advise how to apply this dynamic formating to include more data for example:-

Expenses January Febuary March

Petrol 45 60 50

Cellphone 25 30 25

Hotel 65 75 50

Thank you in advance for any assistance you may be able to offer!

Kind regards,

J13

Jungleist13,

Example, excel table and a bar chart.What excel version are you using and what chart?

Dear Oscar,

Many thanks for your swift response!

Excel 2007 not really bothered about type of chart, column is sufficient I just need to understand haw to apply the dynamic features to it? I can,t figure out how to alter the formating to cover the additional series?

Kind regards,

Jungleist13

Hi -- I am trying to build a line graph that needs 2 series displayed dynamically. How would i go about building that? I underrstand how to do it for one series, but cannot figure out for 2.

Thanks.

Katy

Katy,

Is this what you had in mind?

yes -- where the total number of records being plotted can vary

This is great! I was able to make it work. I do have a concern and a question on this issue that you may be able to help me with. 1) When adding a new date/month to the bottom of your list, the x-axis updates in the graph with the prior data remaining in place. This could lead to an incorrect graph if the data is also not updated. Shouldn't the data also shift over to the left so the added date/month shows blank data in the graph? If so, how? 2) How would this be adjusted for a table where the dates are already pre-populated, only adding in the data each day/week/month?

Clarification - 2) How would this be adjusted for a table where the dates are already pre-populated, only adding in the data each day/week/month?

In this instance, the data table is pre-populated with dates. The graph only shows the most recent 13 entries, rolling each week/month as data is added. To clarify, not all dates are showing in the graph at one time - only the most recent 13.

Eureka! I figured it out - I changed my offset formula for the "months" to reference the month row but count the data row. This results in the table updating the date and data only once the data has been added!!!

Oscar, Thank you SOOOO much. I cannot tell you how much time this will save me on my weekly/monthly reporting! I've been mulling this over for quite some time, not knowing how to do it. You've been a godsend!

Oscar, in line with the questions above, I'm looking to add further columns of data for each month, e.g. Months, Numbers1, Numbers2 etc.

How do you adjust the "=SERIES(,Book3.xlsx!Months,Book3.xlsx!Numbers,1)" formula to include third, fourth and fifth columns?

Question on the NAMES and "SERIES" formulas. Should the NAMES be saved in the SCOPE of "workbook" or the specific worksheet and does that impact the "SERIES" formula? Always use the workbook name or worksheet name instead, depending on how the NAMES were set up? Please advise.

Katy,

Download workbook *.xlsxkaty.xlsx

Instructions excel 20071. Create a table

2. Go to "Insert" tab

3. Click "Line charts" button

New question - I've used these formulas successfully now on a number of graphs. Now, my data is designed horizontally, not vertically and I'm having difficulty converting the formula accordingly. I've tried using "COUNTA(sheet1!$B$2:$RXM$2)" and also changing the last two numbers from "0,13" to "13,0" to no avail. i.e. Months run across row 1 with data in rows underneath with row headers in column A. Please advise.

Another new question - I have difficulty each time I wish to automate a graph with multiple series even thought I have changed the final number in the series (i.e. 1,2,3, etc.) I have charts with stacked columns, and others with two columns with a third series line. When I attempt to change the series information on the graph, it doesn't accept it - no error, nothing, I hit enter to submit it and it just sits there and doesn't change it. Also, is there a limit to the number of names used within a single workbook? Please advise.

Max,

Oscar, in line with the questions above, I'm looking to add further columns of data for each month, e.g. Months, Numbers1, Numbers2 etc.How do you adjust the "=SERIES(,Book3.xlsx!Months,Book3.xlsx!Numbers,1)" formula to include third, fourth and fifth columns?

Excel 2007:Create a table1. Select cell range

2. Click "Insert" tab

3. Click "Table" button

Create a clustered column chart1. Select table

2. Click "Insert" tab

3. Click "Column" in charts window on the ribbon.

4. Click "Clustered Column Chart"

Oscar,

I have used your suggestions above which work as expected, but I have a slight twist on what I am trying to do...

So, firstly I am trying to create a dynamic chart with daily data being added to a column with a weekly total in the eighth row.

I am trying to chart the weekly totals only (ie every eighth row). I seem to be able to do either:

1. Chart Dynamic data

2. Chart every eighth row

But not both together :( Any suggestions? Any advice appreciated.

Missy,

Question on the NAMES and "SERIES" formulas. Should the NAMES be saved in the SCOPE of "workbook" or the specific worksheet and does that impact the "SERIES" formula? Always use the workbook name or worksheet name instead, depending on how the NAMES were set up? Please advise.The names are Named Ranges and does NOT impact the "SERIES" formula. You have to use the full name: excelfile!Named_range in the series forumla.

Example:

Book3.xlsx!Month

Excel 2007 and 2010 users can happily create a table and then create a chart. Nothing to worry about series formulas or named ranges. And yes, I know, the blog post title says Excel 2007:How to create a dynamic chart..

Oscar, can you please help me modify the Name Ranges and SERIES formula for a table where the months (to use your example) are set up horizontally instead of vertically? I am using historical tables that go back five years or so. Changing their layout is not prudent. What I have is column headers with mmm-yy, with multiple row labels of varying categories. I have made attempts by changing the range from columns $A:$A, for example, to rows $A$2:$XX$2, to no avail. Please advise.

Missy,

see this attached file:Missy.xls

Hi Oscar.

I have data similar to what you have but it's more than one row of values. how would i set up it up going across.

Example

months: jan feb mar

values: 1 2 3

values 4 5 6

Values: 7 8 9

I'm not sure how the offset formula will look like so the graph can update automatically when new data is entered. This is the offset that I have for values.

=OFFSET(sheet1!$A$162,0,1,1,COUNTA(sheet1!$162:$162)-1)

Thanks!

jimmy,

I am not sure you can do that in excel 2003 and previous versions. I don´t have excel 2003 but try to convert your data set to an excel defined list and use that list when you build your chart.

If you have excel 2007 and later versions, create an excel defined table.

Thank you Oscar. I shall try this and let you know how it turns out.

Oscar,

Thank you so so much for providing this useful information - your site has the best instructions yet.

However, I do not understand your explanation to Max's question and I have the same question: How do you adjust the "=SERIES(,Book3.xlsx!Months,Book3.xlsx!Numbers,1)" formula to include third, fourth and fifth columns?

Can you please be a little more clear and provide more formulas? Dynamic charts are very new to me and I do not understand it fully yet.

Jennifer,

You don´t need to adjust the formula to include a third, fourth and a fifth column.

Convert your cell range into a table and then create a chart.

In excel 2007 and later versions, a table automatically adds new columns or rows and the chart is instantly updated.

I really like the idea of the dynamic chart, but it doesn't seem to work for me. I have tried changing the source data for the chart to use dynamic named ranges. However, it immediately extracts the range the name references and uses that instead of the keeping the same. What I mean is that, if the current state of the dynamically named range refers to B2:B6, then the chart sets the source data range to B2:B6 and keeps it at that setting, even when the dynamically named range changes. When I look at the source data selection again, it refers to whatever the initial state of the named range was, rather than the named range itself. Am I doing this wrong?

Thanks for any help you can offer.

Paul,

Maybe you have workbook calculation: Manual?

Change it to automatic.

Thanks Oscar, but I think figured it out. I was putting the named range into the slot that pops up with you right click on the graph and shoose "select data." The box says "Chart data range" on it. When I used that box, it always converted the named range into an absolute reference. However, when I went to edit the series (there is only one in my graph), and put the named range in the "Series values" box, it stayed as a named range and my chart updates automatically. I'm not sure why the "chart data range" box would convert a named range to an absolute reference but the "series values" box would not, but that appears to be the situation.

Thank you so much for the info on the charts.

Going back to the Katy chart example, can you convert a regular chart to one that pulls data from a table so that the data will automatically update when new lines/colums are added.

Thanks.

Fatou,

I have simplified this post. I believe it now answers your question.

Thanks for commenting!

i would like my graph to show only the most recent 12 months data. What should i do?

Icjun:

You can have your named range find the last n rows or columns in your data set. Here is an example of some code I used to define a named range:

=OFFSET(Data!$H$43,0,COUNTA(Data!$H$42:$ZZ$42)-2,1,2)

This is based on the idea that there is a 2-row set of data that begins at H42. The values I really want are the last two numbers in row 43. My data set sometimes has holes, so instead of counting the number of items in row 43, I count the header row (42), which I know will be filled in completely, but only up until the last month I want to use. I create a named range using the code above, and then edit a series in my graph to refer to that named range. Now, since you are dealing with the latest 12 months, you might want to have "-12" instead of "-2" after the COUNTA function.

Hi, thanks for providing this information - it's been a great help.

However, I am still struggling to apply the logic to my solution. My data range is made up of: Products in Column A, Months in columns B to M, values (per month per product) in the cross sections.

The Products dimesnion is the one that can grow (or shrink) in my data range. Therefore I want my dynamic chart to show whatever products appear in the data dump

I have defined products as a name. Upon testing, whenever I add a new product it appears as a series in my chart.

However, I am not sure how to display the months (and the values per month, per product) on the chart. In teh "Select data source" tab/Horizontal axix labels - I have manually selected B1:M1. However, only one month is appearing on the X axix of the chart and no data.

Any help would be much appreciated.

Many Thanks

Mike

Hi Oscar,

Going back to my question, I had created a table and used the data to create a chart. However, something happened with the chart and now it is not updating when new data is added to the table. I have multiple employee names in column A, Open and Closed Tickets for each employee in Column B and the date ranges in columns C- X. I have to create an individual chart for each employee showing Open and Closed Tickets per line chart. I was trying to use the named ranges and that is not working. I believe using table and charts will be the best option but something has happened and now the chart is not updating. It has converted back to static where I will have to update it manually. It is very frustrating and time consuming to have to manually update each series for each employee. Your help is greatly appreciated!!!!

Thank you so much.

Fatou

Hi Fatou,

I was having the same problem with the chart converting named ranges to static references. My solution was to use a different named range for each series. Then, when I go to select data, I pick the particular series, edit the data for that, and enter the named range at that location. That seems to work much better than having a named range for the entire data set. The only problem is that it won't work if the number of series in your chart changes (in that case you would have to update the chart manually by adding or removing series).

icjun,

Here are some great resources:

Chart the Last 12 Months Dynamically.

Using named ranges to create dynamic charts in Excel

Mike,

Hi, thanks for providing this information - it's been a great help.However, I am still struggling to apply the logic to my solution. My data range is made up of: Products in Column A, Months in columns B to M, values (per month per product) in the cross sections.

The Products dimesnion is the one that can grow (or shrink) in my data range. Therefore I want my dynamic chart to show whatever products appear in the data dump

I have defined products as a name. Upon testing, whenever I add a new product it appears as a series in my chart.

However, I am not sure how to display the months (and the values per month, per product) on the chart. In teh "Select data source" tab/Horizontal axix labels - I have manually selected B1:M1. However, only one month is appearing on the X axix of the chart and no data.

Any help would be much appreciated.

Many Thanks

Excel 2007 instructionsConvert data range to a table1. Select your range (A1:M5)

2. Go to tab "Insert"

3. Click Table button

4. Click OK

Change chart data range1. Right click on your chart

2. Click "Select data..."

3. Type =Table1 in chart data range:

Chart settings1. Right click on chart

2. Click "Select data..."

3. Click "Switch column/row" button

4. Click Edit button in Horizontal (Category) Axis Labels window

5. Select column headers (B1:M1)

6. Click OK

7. Click OK

Download excel fileSheet1 changes chart data range using vba. Right click on sheet1 and click view code.

Sheet2 changes chart data range using tables (no vba).

dynamic-charts-vba.xlsm

Hi Oscar,

Very good and extensive instructions. Thanks alot!

Fatou,

Can you provide some sample data?

Hi Oscar,

Thank you for responding back. Here is the sample data

Column A - Employee Name

Row A2 - Employee1

Row A3 - Employee1

Column B - Activity

Row B2 - Open Activity

Row B3 - Close Activity

Column C:X - Date Range (Jan 2010-Oct 2011) with additional months added

Rows C2:X3 - # of tickets for each activity

Row A4 - Employee2

Row A5 - Employee2

Column B - Activity

Row B4 - Open Activity

Row B5 - Close Activity

Rows C4:X5 - # of tickets for each activity

There are about 8 employees I am tracking.

The data was arranged in one table and I was trying to create a chart for each employee such that when a new month is added, I will not have to manually go in and update the chart but it will automatically update with the new month data for each employee. am creating a line chart to show each activity per employee and adding trend lines.

Thank you so much for your assistance.

Fatou

Fatou,

When I convert a cell range to a table, it automatically adds new values and the chart is immediately updated. It works here.

What is your excel version?

Did you change chart data range to the table? (See instructions above in my comment to Mike)

You can select an employee using the table filters and the chart is instantly updated.

Oscar,

Thanks for reviewing my question.

My Excel version is 2007.

Maybe my description is not very clear.

I changed the chart data range to the table and it shows me all the information in the table in one chart. However, I need to show each employee in a separate chart and have that chart update when a new month is added. In essence, I will have 8 charts updated when Nov data is added. I am using the one table to showcase all the employees. Do I need to have I need to have 8 tables for each chart in order for this to work.

Thanks!

Fatou,

read this: Excel charts: Multiple series and named ranges

Thank you so very much! It works now. I am not sure what had happened before and it took a couple of tries before I got it to work.

You have been a tremendous help and a life saver. This will definitely cut down drastically the amount of time it will take to update my reports. I appreciate it.

Merci Beaucoup.

Fatou

Oscar,

Using the Missy.xlsx example above you provided on October 17th, 2011 at 8:44 am, I'd like to know how to fix the problem when you have no data to enter for month. For example, using your missy.xlsx file, I added april and may with a value of 4 and 5 respectively. I then deleted the number 3 value under March. When I do that, the chart messes up and doesn't include May. In fact, if you add new months, the chart always leaves off the most recent mont added if you have no value in a cell. It gets worse when you have multiple months with no values. I don't want to use zero as a value since I'm using error bars, which indicate error by 1 standard deviation. If I use zero as a value, the error bars adjust to reflect the zero value. In some months I just won't have data and I need the graph so simply reflect that without dropping off the most recent month or more.

Replying to Seth, because the formula is COUNTING non-blank cells, your theory is throwing off the count. I resolved the same issue using a "-" in an empty cell. It is counted because it is no longer blank, but it has no graphable value. Let me know if this helps.

Missy - Your suggestion fixes only one of my two problems. Yes, it does keep the count going so all months show up on the graph. However, I am using error bars on my graph, which places vertical lines representing 1 standard deviation. This is for my employees to see if their monthly value falls into an exceptable range. Unfortunately, even "--" or "-" or "'--" as a monthly entry makes affects the vertical error bars. The computer thinks the entry is equal to zero and therefore, the standard deviation widens allowing for more error, which is actually incorrect.

Seth, unfortunately I do not have experience using the error bars. However, might I suggest searching the Internet for entries on how to exclude zero value cells from your graphs. I bet you can find something there.

I've been looking and will continue to search. I bet there is something out there too. Thanks for your replies.

I believe I found the answer. Be entering "=NA()", excluding the quotation marks, for any month with no data, it counts the cell and it is not seen as a zero value. Works well!

Seth,

Named range Months formula:

Named range Values formula:

Download excel *.xlsx fileSeth.xlsx

Hi Oscar,

I am using excel 2007.

I have created a dynamic chart for applications/ issue category.

I have 5 teams working on different applications. One team is having more than 1 application.

So how can I make one template, which can be used for all the teams. Also all the issues are not reported in a month so how to exclude those while creating chart.

I am using Excel 2011 for Mac

I have data with alpha headers in A1:P1

Numeric data builds up in rows 2 to 16.

Headers and data are ALL formula derived from other sheets

Converting the data to a table and creating a chart works with 2 issues

1 - conversion to a table changes the alpha headers from formula to text after a warning

2 - the chart data is NOT dynamic and displays for all numeric data cells whether a value or a null

So is there a way to get around to make the chart dynamic where formula derived nulls are ignored?

Or do I have to create named ranges as shown by Oscar in his reply to James (July 14th 2011). If so do I have to define a series for each column, does the chart source data include the header row?

Finally an Excel complaint(!) the boxes to enter formulae when defining a range or chart source data do not expand as you type so it can be awkward to revisit or to find an error

Deep Singh,

Read my answer to seth: http://www.get-digital-help.com/2007/11/03/excel-2007-how-to-create-a-dynamic-chart/comment-page-2/#comment-42350

Can you describe how the template should look like in greater detail?

Paul,

1, I don´t have an answer to you headers problem.

2, You can´t use multicell formulas in a table, convert them into single cell formulas.

You could check if values are empty, something like: =IF(table[ALL]<>"", table[ALL], "")

1. For now I could live with this but take your advice to check with the Office for Mac forum to see if anyone else has tried successfully the same approach to charting

2. Changing the data formula in the data cells to check for nulls in the source does stop the line chart plunging to nothing but the chart's X-axis still extends to the full extent of the table.

=IF(SHEET1!E2='"",NA(),SHEET1!E2)

Unless someone comes up with a solution I will next try a non table approach with a series for each column with a Named Range for the X-axis, somewhere else in my workbook is a count of the number of row entries

Hi, I'm back! I've had great success with these formulas but now I have a new challenge for you. I'm trying to automate reporting as much as possible. This includes prepopulating cells in dependent workbooks with formulas referencing the master workbook, which will be updated with new data. How can I make a dynamic chart in these dependent worksbooks when the cells are already pre-populated? I've tried using date matching to no avail and have thought of adding a new row/column where I'd place a marker to satisfy the "count" but that's not ideal either - I want to not have to update the dependent workbook at all. Any ideas?

Missy,

Can you describe your workbooks in greater detail?

How can I make a dynamic chart in these dependent worksbooks when the cells are already pre-populated?What do you mean by pre-populated?

Sure. What I mean is that the MASTER workbook is already set up with row labels for each month of the current year. The data columns for these rows are blank, with new data to be entered each month. The DEPENDENT workbook is set up with the same row labels for each month but the data columns are set up with formulas to read or calculate the currently blank cells in the MASTER workbook. This way, I don't have to update the DEPENDENT workbook each month - the formulas are already there waiting and the value will update once the data is entered in the MASTER workbook. If I am graphing from the DEPENDENT workbook, I cannot COUNT the non-blank cells, because there are none - the cells are populated with formulas. My temporary fix is to add a new column with an "X" value to identify the most recent graphing month and the COUNT would work on this column. Ideally, I don't want to have this "X" column or have to update the workbook at all.

Hi Paul,

Re:"Finally an Excel complaint(!) the boxes to enter formulae when defining a range or chart source data do not expand as you type so it can be awkward to revisit or to find an error..."

Yes it does...

On the left of the formula bar you'll notice the "fx" sign, and on the right side of the formula bar you'll see a box with an arrow down...

Click on the arrow and drag the lower portion of the formula bar to the desired length...

2. ... but the chart's X-axis still extends to the full extent of the table.

mean to say your #N/A are not plotted, but the range in x are fixed to a value that is not present in your data? Is that correct? is your range set on manual or automatic? if auto it should resize with the new range...

I wish I could be of more assistance but I do not understand fully what problem you encountered...

can you share a sample of your file?

Cheers

Cyril.

I would willingly send a sample file if I knew how to do it! Please let me know, feeble excuse is that I am new to this sort of thing!

Paul you can use an external page such as (http://uploading.com/) but I suggest that you directly ask Oscar since this is is web page, I am quite sure he has all the answers you may ask, mine are quite limited... I am however quite interested in your query since you encounter some problems on excel2011.

I tried the create a file following your descriptions and so far it works as Oscar explained, but you might be referring to something different. (I am using v14.1.4).

How do I contact Oscar? The link at the top of the post tries to access something that is not there.

My version of Excel for Mac 2011 is also v14.1.4

Paul, upload a sample to the link I mentioned, i'll have a look since i am using mac, just let us know the name of the file... As I said Oscar is the authority here but since what is described here works with me, and since it might be a mac related problem... awaiting your feedback.

Missy,

Check out the attached file:

Missy1.xlsx

The chart uses a dynamic named range (Rng). Column B have formulas and they get their values from column A.

Cyril

file W_L test.xlsx should be available at uploading.com

Paul

Paul, kindly give the file links it should look like this:

http://uploading.com/files/m6aa3fb3/W_L test.xlsx/

go to upload web site, login, click on your file, click on the "share" button and copy the "File Links"

sorry for the delay...

Having trouble signing on to Uploading site. Will get back to you ASAP

Cyril

Oscar has provided a solution. Simply when I defined the chart "data source" range I included empty row cells. I did not realise that the data source range expands as data is entered.

Have not heard from Uploading support as to why I cannot login

Thanks for your patience, it was/is appreciated

Paul,

Glad you found out.

Cheers.

Hi all, do you know how to create the dynamic Range chart from a SINGLE column. Example

Age

----

1

2

2

1

Thus in my Chart it caculates how many times, "2" occurs and "1" occurs. Is this possible. Pivot it is possible, but I need to manually refresh it.

Thanks

Joseph,

Oscar will definitely give you the answer, but coud you clarify, you are just looking for the count?

Hence 1 =2 and 2=2 then your graph will display a value of 2 for age 1 and a value of 2 for age 2?

Joseph,

something like that?

Type new age in Column A "age"

http://uploading.com/files/6b7mf4m6/joseph.xlsx/

although I find this cumbersome...

Column "occurrence" will count how many times each age appears in the list

Column "age sorted" is to avoid redundancy and clear the graph with only one value per age

Column "count" is the one giving you the graph.

the list is dynamic, the chart as well.

Oscar will definitely come up with something better.

Cheers.

Joseph,

Sorry for the late answer.

Named range:

Is this what you are looking for?

Hi,

Can named ranges be used in error bars?

I've set up a line graph to dynamically change using the offset function but when I try and enter a named range for the error bars I get an error or it defaults to 0 or 1.

Thanks

Tom

As a follow up question to your response about Tables in Excel 2007 on August 22, 2011, the data I am drawing from in Column A (on Sheet3) of my Table that becomes the data on my horizontal axis is based on input from another page (i.e. user inputs "54" on Sheet1 and the horizonal axis for my chart on Sheet2 draws from the first 54 inputs in the table on Sheet3). So in order for the horizontal axis to be updated I have to go in each time click the filter icon on top of Column A, then click okay. Any suggestions?

Scott,

So in order for the horizontal axis to be updated I have to go in each time click the filter icon on top of Column A, then click okay.Yes, or create a macro. Change table name in the macro below.

1. Right click on sheet name

2. Paste code in sheet module

3. Exit vbEditor

Hi Everybody,

Can anybody help me out in creating Dynamic Chart of the this type.

Here i have used Stacked Bar Chart but in order to create the required display , i have used the option " Switched Rows/Column" and after switching i am not able to make the graph Dynamic.

A Quick help would be really grateful.

I Dont know how to attach the Sheet so here's the screenshot of the data and the chart which i need to make Dynamic :

A 10 15

B 20 35

C 40 55

And the chart type would be 1. Stacked Bar Chart and then Switched Rows/Column.

I am not getting an option for attcahing the Excel.

Can anybody help me out?

Thanks.

Oscar,

I used your method from your July 14th 2011 post to create a dynamic chart that had data derived from if functions. This worked in a simple practice workbook but when I try to use the same process in my actual workbook I get an error when i try to edit the ranges like in steps 4 through 7 of Setting Up the Chart as shown at the top of this page.

The error reads....A formula in this worksheet contains one or more invalid references. Verify that your formulas contain a valid path, workbook, range name, and cell reference.

Any suggestions?

My guess is you forgot to add the sheet reference, in my example

Sheet1!NumbersHello!

I am struggling here big time.. And I would really appreciate your help!

I have a table where names of columns are dates (updated every week so are formulas) -> for this reason I cant use Insert -> Table because then formulas will become the text.

Category 01/01/2011 01/02/2011 etc etc

Product 1

Product 2

Based on drop down menu, the number of products varies but number of columns (weeks) stay always the same. I cant build any dynamic chart that would accept 2 products and show ONLY these two products in the line chart, and at the same time also accept 12 products once selected in drop down menu...

Could you please help me?

Thank you!!!!

Jana,

I am struggling here big time.. And I would really appreciate your help!

I have a table where names of columns are dates (updated every week so are formulas) -> for this reason I cant use Insert -> Table because then formulas will become the text.

Category 01/01/2011 01/02/2011 etc etc

Product 1

Product 2

I am not getting formulas converted to text when creating a table. What excel version are you using?

Hi,

in series values in select data windows I'd like to write

=Sheet1!A2:INDEX(A2:A6;B1;1)

I'd like to plot A2 to rows that indicated in B1

pls help

morteza,

Create a named range

Rows : =Sheet1!$A$2:INDEX(Sheet1!$A$2:$A$6, Sheet1!$B$1)

Change series values in chart

1. Right click on chart

2. Select "Select data"

3. Click "Edit" button (below Legend Entries)

4. Type in series values: =Sheet1!Rows

5. Click Ok!

6. Click Ok!

Download *.xlsx file

Dynamic-chart-morteza.xlsx

Thanks a lot

Dear Oscar,

I currently have a number of worksheets: some contain data from A3:X367, other worksheets contain data from A3:AV367.

This data describes hourly and half-hourly data of a building respectively: the rows signify the days, columns the hour or half-hour.

I would like to create a macro which automatically creates a scatter-graph (with smoothed lines) showing the data on the y-axis. On the x-axis, instead of the time the data represents, I would like the month to be shown. So for example, data from rows A3:34 would fall under January and so forth. I would like this macro to work on worksheets which contain both hourly and half-hourly data.

Is it possible for this to be achieved and if so, could you please help me?

Thank you very much Oscar.

Sincerely,

Joseph

Hi Oscar,

I am sorry if you previously answered this question. But i cannot find an answer anywhere i look.

How do you make a dynamic graph that automatically only keeps say the 14 previous weeks worth of data in the graph?

I hope this makes sense,

Many thanks,

Amy

Amy, I use this all the time for a 13 week trending graph.

Set up "Names" using this formula: =OFFSET(Worksheet!$A$33,0,COUNTA(Worksheet!$17:$17)-13,1,13)

(Use the fx feature to determine what each component means; in your instance, change the 13 to a 14; also THIS is for when the dates are set up horizontally across the workbook)

The graph SERIES is then =SERIES(wORKSHEET!$B$11,'WORKBOOK.xlsx'!Months,'WORKBOOK.xlsx'!DATA,1) where "Months" and "DATA" are Names in the workbook.

If the data is set up vertically on the page, the Names formula becomes =OFFSET(WORKSHEET!$C$1,COUNTA(WORKSHEET!$E:$E)-13,0,13)

I hope this helps!

Hello,

I’m new working with dynamic charts using Excel 2007. I created a dynamic bar chart using 2 series of yearly sales. I have defined range names FW for series 1 and SS for Series 2. I would like to display each respective bar from each series in blue each time sales increase from the previous year and in red each time the sales decrease from previous year.

How would I go about doing this?

Thanks.

Peter

Peter,

see this post:

Change bar color in charts (vba)

[...] charts (vba)Filed in Charts, Excel, vba on Oct.12, 2012. Email This article to a Friend Peter asks:Hello, I’m new working with dynamic charts using Excel 2007. I created a dynamic bar chart using 2 [...]

Thanks for the post, really helped me a lot today...

Steven,

I am happy you liked it!

Hi

Please help me to merge two table in a chart.

Data in table 1 :

Pass: 23%

Fail : 40%

executed :20 %

Data in Table 2:

Pass: 13%

Fail : 50%

executed :10 %

I have created two seperated bar charts

but i want to have one chart that gives a comparision between two charts in one.

some what like you explained in

December 1, 2011 at 2:09 pm responce.

I am using excel 2003 version please proved step to do so .

on x axis i want to have pass, fail, executed

on y axis the %age.

[...] Excel 2007: How to create a dynamic chart [...]

hi oscar,

i have an excel file as

country aug sep oct

--------------------------

ind 30 60 90

aus 40 50 60

us 60 90 90

I want to draw a dynamic chart, by having ind, aus, us in y axis and aug, sep, oct in x axiz

and any new values are inserted, chart has to be updated dynamically.

hi Oscar,

pls reply to my above query as i follow your method to create references and work fine when ind, aus, us in X axis and aug, sep, oct in Y axiz but when i click on switch row/column it won't work dynamically. my new values were not updated to the chart.

(I want to work it dynamically when ind, aus, us in Y axis and aug, sep, oct in X axiz)

revanth,

I think this is what you are looking for:

Dynamic chart – Display values from a table row or column

hi Oscar, i have this data in my excel file

country aug sep oct

--------------------------

ind 30 60 90

aus 40 50 60

us 60 90 90

i wrote 4 named ranges as country = =OFFSET(Sheet1!$A$2,0,0,COUNTA(Sheet1!$A:$A)-1)

aug = =OFFSET(Sheet1!$B$2,0,0,COUNTA(Sheet1!$B:$B)-1)

sep = =OFFSET(Sheet1!$C$2,0,0,COUNTA(Sheet1!$C:$C)-1)

oct = =OFFSET(Sheet1!$D$2,0,0,COUNTA(Sheet1!$D:$D)-1)

and click on chart and add these named ranges to the series values "aug,sep,oct" and add named range country to axis labels.

so, it works fine when i have added new rows to the sheet, chart gets updated.

but, when i have click on switch row/column it does not gets updated with new values.

why i have click on switch row/column is I want country as series and aug,sep,oct as axis lables.

highlighted point is I want country as series and aug,sep,oct as axis lables.(generally when we add a 2d column chart it comes with aug,sep.oct as series and country as axis lables)

I am not sure whether i have followed the correct way or not, but the above stated is my input data and i want

a dynamically updated chart with country as series and aug,sep,oct as axis lables.

pls reply oscar it is critical for us

hi oscar,

what i mean to say is in the first example Dynamic chart.xlsx you have use January, February, March... in x-axis and use values in y-axis I want to reverse these and work dynamically when update values chart gets update

revanth,

is this what you are looking for?

I copied your table (cell range A1:D4).

Paste special (transpose) to cell A6.

Create a table

Select the table

Insert a column chart

Add more values to the table and the chart expands automatically.

hi oscar,

this is the resulted chart i am looking for, but dont want to change the table structure, more over we are using a third party tool talend and from that data will come automatically and insert into cells and chart gets updated.

but using dynamic table we need to manually press tab button , then only data gets updated in chart.

But by using our tool data will just come and inserted into respective cells..

revanth,

Here is the original table structure.

I switched row/column and then I added data (nov) and the chart expands automatically. What excel version are you using?

Thanks Oscar, this helped me alot..

Oscar,

I see above you used the "MATCH" function when the data was in rows and one cell was blank. I have a dynamic graph that has data entered in columns with some cells being blank. I copied the example you gave Seth in Jan 2012, but keep getting an error when trying to adapt it.

Here is what I have

Date Column: =OFFSET(Dynamic!$A$2,0,0,MATCH("ZZZZZZZZZZZZZZZ", Dynamic!$A:$A)-1)

Data Column: =OFFSET(Dynamic!$H$2,0,0,MATCH("ZZZZZZZZZZZZZZZ", Dynamic!$H:$H)-1)

and get an error about an invalid reference and am asked to "Verify that you formula contains a valid path, workbook, range name, and cell reference".

Thanks for any insight you can provide.

Shane,

I think you are using excel 2003?

Try this formula:

=OFFSET(Dynamic!$A$2,0,0,MATCH("ZZZZZZZZZZZZZZZ", Dynamic!$A$1:$A$65000)-1)

RE: Excel 2007 & 2010 Charts from a table.

I have tried this over and over but the chart will not expand when new data is added. It is only one column with numbers 0-365 in them. I think it may be because there is a formula in the column. It calulates days over due from columns B and P and the formula puts in the number in column W;-the table I made.

the formula in W is =IF(B26=0, " ", IF(P26="",DAYS360(B26, TODAY()),DAYS360(B26,P26))) I have tried the old 'define name' system but the same results. ..also calc is set to auto and all that stuff. Any Ideas??? Pleeeese.

Thanks in advance....Dan P.

DanielP,

That is weird. The third column (New Amount) contains formula. When I add a new record to the table the formula is automatically copied to the new row.

Thanks, After looking at your example I thought maybe because I only made a table for column W, that may be my dilemma; So I made a new table for the entire data series; A1 thru W25,( the last entry). So..I input data for the next row and wala! It worked! BUT..It would only do 1 row (26). When entering more data, rows 27,28 ect. It did not carry down the formula so the chart would update. Under Options/ Proofing & advanced settings all are checked to extend tables and formulas. (default). I know I must be doing something wrong..It's driving me nuts. :( I'll keep trying.

Dan P

O.K. I think I figured it out. I can get this to work IF I enter 'TAB' in the last row & column of the table. However, users will only input data in colum B & P, then they save and close the sheet. Column W is auto calculated by the formula to give a number;(for the chart). No users will ever be in column W. I will need to find a new way to accomplish this. Suggestions greatly appreciated.

Dan P

DanielP,

users will only input data in colum B & PIf they add data to the row below the excel defined table, it automatically appends the new data.

Just want to ask, what if I got title headings for A1 and B1 (such as month and sales). I don't want them to count it as part of the data.

Thanks

S.Wong

I assume you talk about named ranges.

=OFFSET(Sheet1!$A$1,0,0,COUNTA(Sheet1!$A:$A))

becomes

=OFFSET(Sheet1!$A$2,0,0,COUNTA(Sheet1!$A:$A)-1)

Hi Oscar,

Firstly, your website ROCKS. Valuable info and great examples.

On to my questions:

1. My chart looks the same whether I have COUNTA "-1" or "1". What is the difference?

2. How would I do a sum for distinct names? For example,

John 2

Jack 4

Larry 9

John 5

Mary 2

John 3

I want my chart to show one instance of John with 10.

Thank you.

I wanted to see data of latest 5 rows/columns and previous data should not be shown in chart. Means only 5 bars will be seen in chart.

How to accomplish this, I tried with the way mention in this thread but could not get what I wanted.

Thank you,

Kishor

Kishor,

I think this might be helpful:

http://peltiertech.com/Excel/Charts/DynamicLast12.html

Thank a lot,

It solved my problem.

Regards,

Kishor

Good afternoon,

I wonder if you can help. I am using 2007 and I would like to create a dynamic chart. I can use the table function and this works well. However, I dont want to manually go into my axcel rport weekly and update the data, I want to output the data from a SAS dataset to excel and the charts update themselves. I cannot get a formula to work. Basically my data would be a rolling 4 weeks data changing as below and I would like my line graphs to update accordingly. Does anyone know if this can be done and how I can do this without the report requiring manual intervention?

First Week Example

WK_Beg BOOK SHOES SOCKS

02/09/13 125.69 25498.24 215.14

09/09/13 25.48 7895.15 1596.45

16/09/13 1234.25 157894.29 1.25

23/09/13 25.96 4584.59 259.67

Second Week Example

WK_Beg BOOK SHOES SOCKS

09/09/13 25.48 7895.15 1596.45

16/09/13 1234.25 157894.29 1.25

23/09/13 25.96 4584.59 259.67

30/09/13 1597.57 15973.27 1579.98

Kind Regards

hi,

Can you able to help in this. I am having an issue with my dynamic chart. I don't want to display the table last calculated row in my chart. Upto before the last row, i need to display in chart. But the table content is dynamic. Can you please tell me how to create a dynamic chart for all my rows except the last row.

for example

Please find the below image.

http://postimg.org/image/q1wmig98j/

In this image if you see my data will fall between the red mark. it will update dynamically. so my chart also have to create dynamically based on the value. how shall i get this chart. if i am using offset function , i am having problem with the last row of my data. i want to eliminate the last row data in chart.

Thanks and Regards

Ava

ava,

I am not sure I understand. You want the last row (CAD) removed from the chart?

Are you using an excel defined table? If that is the case, filter the Currency column, uncheck CAD. Click OK.

Hello,

I'm hoping you can help, Please.

The spreadsheet I'm trying to create a bar graph for, has the names of the salespeople (column A), Weekly data (column B - 2/1/14, column C - 2/8/14, column D - 2/15/14, column E - 2/22/14), Monthly data (formula to add the weekly numbers - column F - Feb 14). (This is for each month.) I highlighted the salespeople (column A) and the four week dates (column B, C, D, E), Clicked on Insert, Column chart, 2-D bar chart, Click on Switch Row/Column. This is what I want, however it automatically adds additional dates in between the weekly dates. I cannot figure out how to eliminate the additional dates. I just know there's a simple fix for this, but for the life of me can't figure it out. Can you please help?

Thank you in advance,

Desi

See...

All I needed to do was type this all out....

I just figured it out.

Thank you!

Have a GREAT day and an even better weekend!!

Hi Oscar,

Thanks for helping so many people! I have a question myself about dynamic graphing. I have been following the instructions from http://blog.contextures.com/archives/2009/05/03/select-excel-chart-dates-from-a-drop-down-list/#comment-84820 because I have excel graph from point A to point B.

However, the last step, changing the series range, does not work for some reason. I am using a pivot table because all of my data is in another sheet. The table includes values and dates. Also, changing the series manually as David said does not work for me - it is grayed out.

Thanks for the help.

Best,

Ameya

Hi There,

I have 2 questions

1) If I have formulas in one cell but they get populated from another sheet when there is data. However, it looks like my dynamically updating chart is taking those formulas as filled cells and updating the graph. How can we avoid this happening?

2) If we have 3 data fields on a monthly graph, how do I create a dynamically updating stacked graph?

thanks!

[…] Excel 2007 : How to create a dynamic chart | Get Digital … – Question: How do I create a chart that dynamically updates the values, as i type them in the workbook? Answer: Excel 2007 (and later versions) users, create… […]

Hello,

Need help in creating the chart which pulls the data from different sheets, i just need to dump the set of data in sheet2 and it should pull the data from sheet2 and prepare the chart in Sheet1 (main sheet), can this be done. Please let me know.

Waiting for the soonest response, thanks advance.

Thanks