Sub topic 3
Converting the Range to an Excel Table
This chapter assumes you can move around a workbook, enter data and simple formulas such as SUM, and that your data is already laid out with one header row and one record per row. Here you will turn that range into an Excel Table, so the PivotTable you build later follows the data as it grows.
Why a plain range is a weak PivotTable source
When you create a PivotTable from a plain range, Excel stores a fixed address such as Sheet1!$A$1:$E$6. If you add a row at the bottom, that address does not change. The new record is outside the source, and the PivotTable ignores it even after a refresh.
You can fix this by editing the source address by hand each time. That is easy to forget, and the PivotTable then reports totals that look correct but are incomplete.
An Excel Table avoids the problem. A Table is a named object that automatically expands when you add rows or columns. A PivotTable based on a Table points at the Table's name, not at a cell address.
Starting data
The examples use this dataset. Paste it into a worksheet starting at cell A1, or type it in.
Date,Region,Product,Units,Sales
2025-01-05,East,Widget,10,250
2025-01-12,West,Gadget,4,180
2025-02-03,East,Gadget,7,315
2025-02-14,West,Widget,12,300
2025-03-09,East,Widget,5,125Converting the range
- Click any cell inside the data, for example B3. You do not need to select the whole range. Excel detects the block of contiguous data around the active cell.
- On the Insert tab, choose Table. The shortcut is Ctrl+T (Ctrl+L also works).
- In the Create Table dialog, check that the range shown is
=$A$1:$E$6. - Make sure My table has headers is ticked. Excel guesses this by looking at the first row, and it can guess wrong if every column in your data is text.
- Select OK.
The range gains banded rows, filter arrows on the header cells, and a new Table Design tab on the ribbon. That tab appears only while the active cell is inside the Table.
Naming the Table
Excel names the first Table Table1, the next Table2, and so on. These names tell you nothing, so rename the Table before you build anything on it.
- Click inside the Table.
- On the Table Design tab, find the Table Name box at the far left.
- Replace
Table1withSalesDataand press Enter.
Table names follow these rules:
- They must start with a letter, an underscore or a backslash.
- They cannot contain spaces. Use
SalesDataorSales_Data. - They must be unique in the workbook, and they cannot look like a cell reference such as
Q1orR2C3.
You can also see and jump to Tables through the Name Box, next to the formula bar, or through Formulas > Name Manager.
What changes after conversion
| Behaviour | Plain range | Excel Table |
|---|---|---|
| New row typed directly under the data | Not part of the range | Table expands to include it |
| New column typed next to the headers | Not part of the range | Table expands to include it |
| PivotTable source reference | Fixed address such as `$A$1:$E$6` | Table name, such as `SalesData` |
| Formulas in a new row | Must be copied down by hand | Calculated columns fill automatically |
| Header visibility when scrolling | Scrolls out of view | Column letters in the grid are replaced by header names |
| Duplicate or blank header text | Allowed | Excel renames duplicates, for example `Sales2` |
The sixth row of the table matters. Header cells in a Table must be unique non-empty text. If two headers are both Sales, Excel renames the second to Sales2. If a header cell is empty, Excel fills it with Column1, Column2 and so on. A PivotTable also refuses to build from a source with a blank header.
Seeing the expansion work
Click the cell directly below the last Sales value (E7 in this dataset) and type values across the new row. Press Tab after the last cell in the last row, and Excel adds a new Table row. You can also type straight into row 7. Either way, the Table border and banding grow to include it.
Add this record:
2025-03-21,West,Gadget,9,405The Table now covers $A$1:$E$7. Because a PivotTable built on SalesData points at the Table, its source grows with it. You still need to refresh the PivotTable to see the new row, which a later chapter covers. The Table makes sure the new row is in the source. Refresh makes the PivotTable read it.
A calculated column
A Table can also hold a formula that fills down automatically. This is called a calculated column. In F1, type the header AvgPrice. The Table expands to take in column F. In F2, type this formula, clicking cells instead of typing their addresses:
=[@Sales]/[@Units]The [@Sales] notation is a structured reference. It means "the Sales value in this row of this Table". Excel copies the formula to every row at once, and it also fills it in for any row you add later.
Compute AvgPrice in the source only when you need it as a plain field. If you only need an average price in the PivotTable, a PivotTable calculated field gives a different result, because it sums Sales and Units first and then divides. That difference is covered in the chapter on calculated fields.
Common mistakes
- Merged cells in the header row. A Table cannot be created over merged header cells in the usual way, and merged headers cause trouble in PivotTables. Unmerge them first.
- Blank rows in the data. Excel's auto-detection stops at a fully blank row. Check the range in the Create Table dialog, and correct it if it stops early.
- Leaving the default name.
Table1becomes hard to tell apart fromTable2once a workbook has several PivotTables. - Converting back by accident. Table Design > Convert to Range turns the Table into a normal range. Formulas keep working, but the automatic expansion stops. PivotTables built on the old name may stop working.
- Linking to a stale address. If you built a PivotTable before converting, its source is still the old fixed address. Changing that source is covered in the chapter on refreshing and changing the data source.
How it connects to the PivotTable
In the next chapter you insert a PivotTable. When you click inside the Table first, the Create PivotTable dialog fills the Table/Range box with SalesData. Keep that name. Do not replace it with a cell address, or you lose the benefit.
Exercises
Exercise
You converted a range to a Table and left its name as Table1. List two rules a new name must follow, and give one valid name.
Show answer
A Table name must start with a letter, underscore or backslash, cannot contain spaces, must be unique in the workbook, and cannot look like a cell reference such as Q1. Any two of these are acceptable. A valid name is SalesData.
Exercise
A colleague built a PivotTable from the fixed range A1:E6, then added a row 7 below the data. After a refresh, the new row does not appear in the PivotTable. Explain why, and describe how an Excel Table would have prevented it.
Show answer
The PivotTable source is the fixed address A1:E6, which does not change when a row is added below it, so refresh reads only the old range. If the data had been converted to a Table and the PivotTable built on the Table name, the Table would have expanded to include row 7, the source would have grown with it, and a refresh would have picked up the new record.
Exercise
After typing a header over column F, you enter =[@Sales]/[@Units] in F2. What does [@Sales] mean, and why does the formula fill down without copying?
Show answer
[@Sales] is a structured reference to the Sales value in the same row as the formula. Because the formula sits in a Table column, Excel treats it as a calculated column and fills it into every row, including rows added later.