Sub topic 3
Converting the range to an Excel Table
This chapter assumes you can navigate workbooks and worksheets, and that your data already has one header row and one record per row, as set up in the previous chapter. You will convert that range to an Excel Table so a PivotTable built on it can pick up new rows.
Why use a Table as the source
A PivotTable built on a plain range such as A1:E6 stores that fixed address. If you add a row 7, the PivotTable does not include it, even after a refresh. You would have to change the data source by hand each time.
An Excel Table is a range that Excel treats as one named object. It grows when you type directly below it or paste rows under it. A PivotTable that uses the Table as its source follows that growth. After you refresh, the new rows are included.
Convert the range
Use the sample sales data from the plan. Paste it into a worksheet starting at A1.
- Click any cell inside the data, for example B3.
- Press Ctrl+T, or choose Insert, then Table.
- In the Create Table dialog, confirm the range is
A1:E6. - Check My table has headers, then choose OK.
Excel applies banded formatting and adds filter buttons to the header cells. The Table Design tab appears on the ribbon whenever a cell in the Table is selected.
Name the Table
Excel names the first Table Table1. Rename it to something descriptive, because the name appears in the PivotTable's source box and in formulas.
- Select a cell in the Table.
- On the Table Design tab, find Table Name at the left.
- Type
SalesDataand press Enter.
Table names must start with a letter or underscore, and they cannot contain spaces.
Check that it works
Add a row directly below the last record, with the date 2025-03-15, region West, product Gadget, 6 units and sales of 270. The Table border expands to include it. Type in the cell immediately under the Table, and do not leave a blank row between them, because a blank row stops the expansion.
When you later insert a PivotTable, you can type SalesData in the Table/Range box. If your cursor is inside the Table when you start, Excel fills in the name for you.
Exercise
You built a PivotTable on the plain range A1:E6 and then added a seventh row of data below it. After you refresh, the new row is missing from the PivotTable. What should you do so that future rows are included automatically?
Show answer
Convert the data to an Excel Table with Ctrl+T, then change the PivotTable's data source to the Table name, such as SalesData. After that, rows added to the Table are included when you refresh.