Sub topic 14
Charts that grow with your data using Tables
This chapter assumes you can insert a chart from a selected range, and that you know what series and categories are. It also assumes you have used Select Data to change a chart's source. If not, review those chapters first.
Why a fixed range goes stale
When you insert a chart from a plain range such as A1:B5, the chart's series formulas point to those exact cells. If you add a fifth region in row 6, the chart does not include it. You have to open Select Data and extend the range by hand.
An Excel Table fixes this. A Table is a named range that expands automatically when you type in the row below it or the column beside it. A chart built from a Table range follows that expansion.
Convert the range to a Table
Use the sales layout from earlier chapters, with Region in column A and Sales in column B.
- Click any cell in the data.
- Press Ctrl+T, or choose Insert > Table.
- Confirm that "My table has headers" is checked, then select OK.
Excel applies banded formatting and shows the Table Design tab. You can rename the Table in the Table Name box at the left of that tab. A name like SalesTable is easier to recognize than the default Table1.
Build the chart from the Table
Select any cell inside the Table, then choose Insert > Column or Bar Chart > Clustered Column. Excel charts the whole Table body, with the header row supplying the series name.
Now add a new row. Type Central in cell A6 and 110 in B6. The Table grows to include row 6, and the chart adds a sixth column without any other action.
Check the series formula
Click a column in the chart and look at the formula bar. You will see something like this:
=SERIES(Sheet1!$B$1,Sheet1!$A$2:$A$5,Sheet1!$B$2:$B$5,1)The references look fixed, but Excel tracks them against the Table's boundaries. When the Table grows, Excel rewrites the references itself. This is why the chart updates even though you did not enter a dynamic formula.
Common errors
- Typing with a gap. If you leave an empty row between the Table and your new entry, the Table does not expand. Type directly in the row below the last one.
- Charting a range next to a Table. If you select cells by dragging and the selection does not match the Table's body, the chart may not be linked to it. Click inside the Table and insert the chart from there.
- Blank rows and totals. A Total Row is not charted as a data point by default when the Table body is the source. If you extend the source by hand to include it, the total will appear as another category, which distorts a pie chart.
- Deleting rows. Removing a Table row removes its data point from the chart. This is expected, but check pie charts, because the remaining slices then add up to 100% again with new proportions.
Exercise
You built a column chart from a plain range A1:B5. You then added a row 6 of data, and the chart did not change. Name two steps that make future rows appear automatically.
Show answer
Convert the data to a Table (click a cell, then press Ctrl+T), and then create the chart from a cell inside the Table, or reselect the chart's source to cover the Table body. After that, new rows typed directly below the Table extend both the Table and the chart.