Sub topic 7
How tables grow with your data
This chapter assumes you can create a table from a range, that you know a table has a name (for example SalesTable), and that you can read basic A1 references. Here you will see how a table expands when you add data, what expands with it, and why this matters for formulas.
What automatic expansion means
A plain range has fixed edges. If you type a value in the row under a range, the range does not include it. Any formula that points at B2:B20 still ends at row 20.
A table treats the area it covers as a unit. When you add data next to it, Excel extends the table to include the new data. Everything that depends on the table then follows.
Ways to make a table grow
- Type in the row directly below the last row. The table adds a row.
- Paste data in the row directly below the table. The table adds the pasted rows.
- Type in the column directly to the right of the header row. The table adds a column, and the value you typed becomes the new header.
- Press Tab in the last cell of the last row. Excel adds a new row and moves into it.
- Drag the small handle at the bottom right corner of the table.
- Use Insert on the Home tab, or right-click and choose Insert, to add rows or columns inside the table.
If the new row is not adjacent to the table, for example there is a blank row between them, the table does not expand.
What expands with the table
When the table grows, these items grow too:
- Formatting, including banded rows and the table style.
- Calculated column formulas, which fill into the new row.
- Data validation applied to a whole column.
- Structured references to the table, such as
SalesTable[Amount]. - Charts, PivotTable sources and named ranges that point at the table's columns.
- The total row, which stays at the bottom and moves down.
See the difference with a formula
Suppose SalesTable holds sales data and has an Amount column. Enter this formula outside the table:
=SUM(SalesTable[Amount])Add a new row under the table with an amount of 250. The result increases by 250 and you do not edit the formula. With a plain range, =SUM(C2:C20) would ignore the new row until you changed the reference.
Common errors
- A blank row separates the data from the table. Excel does not treat the new data as adjacent. Remove the blank row or use the resize handle.
- Automatic expansion is turned off. Go to File, Options, Proofing, AutoCorrect Options, then the AutoFormat As You Type tab. Make sure "Include new rows and columns in table" is selected.
- Something sits below the table. If cells below the table contain data, the table cannot add a row there. Excel may ask whether to overwrite them or not expand. Move the data or place it beside the table.
- Another table or a merged cell is in the way. Tables cannot expand into or across these.
- Using fixed references elsewhere. A formula such as
=SUM(C2:C20)may update when rows are inserted inside the range, but it does not update when rows are added at the end. Use a structured reference instead.
Resizing manually
You can also set the table's extent yourself. On the Table Design tab, choose Resize Table and enter a new range. The header row must stay in the same row, and the new range must still include it. Resizing is useful when you want to add many rows at once, or when you want to shrink a table that grew too far.
Exercise
A table named SalesTable ends at row 20. You type a value in row 22, leaving row 21 empty. Does the table expand? What would you do to include the new row?
Show answer
No. The table only expands when the new data is directly adjacent, and the blank row at row 21 breaks that. Move the value into row 21, or use Table Design, Resize Table to extend the range to include row 22. Delete the blank row if you do not need it.
Exercise
You use =SUM(C2:C20) outside a table covering C2:C20, and then you add a row at the bottom of the table. Why is the total wrong, and how do you fix it?
Show answer
A fixed A1 reference does not follow a table when rows are added at its end. Replace it with a structured reference such as =SUM(SalesTable[Amount]), which always covers the whole column.