Sub topic 5
Giving the table a meaningful name
This chapter assumes you can create a table with Ctrl+T and write ordinary formulas. It covers how to rename a table and why the name matters.
Why the default name is a problem
Excel names each new table Table1, Table2 and so on, in the order you create them. These names tell you nothing. A formula like =SUM(Table3[Amount]) forces you to open the workbook and look up what Table3 holds.
The table name is the first part of every structured reference. A name such as SalesTable makes formulas readable and makes them easier to find in a workbook with several tables.
Renaming a table
- Click any cell inside the table.
- Open the Table Design tab on the Ribbon. Older versions call it Table Tools > Design.
- In the Table Name box at the far left, type the new name.
- Press Enter.
You can also use Formulas > Name Manager, select the table, and choose Edit. The Table Name box is faster for a single table.
Naming rules
Excel rejects a name that breaks these rules.
| Rule | Valid example | Invalid example |
|---|---|---|
| Starts with a letter, underscore or backslash | `Sales_2026` | `2026Sales` |
| Has no spaces | `SalesTable` or `Sales_Table` | `Sales Table` |
| Is not a cell reference | `Orders_Q1` | `Q1` or `R1C1` |
| Is unique in the workbook | `SalesTable`, `CostTable` | two tables named `SalesTable` |
| Has no more than 255 characters | `SalesTable` | a 300-character name |
Names are not case sensitive. salestable and SalesTable count as the same name, so you cannot use both. Table names also share one list with defined names, so a table cannot reuse a name you created in Name Manager.
A naming convention
Pick one convention and use it in every workbook. Two common choices:
- A descriptive noun with a suffix, such as
SalesTableorCustomerTable. - A short prefix, such as
tblSalesortblCustomers.
Choose names that describe the content, not the layout. SalesTable still makes sense after you add columns. LeftTable does not.
What happens to existing formulas
Renaming a table updates every formula that refers to it. Suppose a cell holds this formula:
=SUM(Table1[Amount])After you rename Table1 to SalesTable, Excel rewrites the formula for you:
=SUM(SalesTable[Amount])This works because Excel stores the reference to the table itself, not the text you typed. Rename a table at any time without breaking formulas on any sheet.
The same name also works as a navigation tool. Select it from the Name Box dropdown, or press F5, type the name and press Enter. Excel selects the table's data area.
Setting the name with VBA
In VBA, the Name property of a ListObject sets the table name. The macro below renames the first table on the active sheet.
Sub RenameFirstTable()
Dim tbl As ListObject
Set tbl = ActiveSheet.ListObjects(1)
tbl.Name = "SalesTable"
End SubIf the workbook already has a table or defined name called SalesTable, this line raises a run-time error. Later chapters use the same property when they create tables from code.
Common errors
- "The table name is not valid" message. The name has a space, starts with a digit, or looks like a cell address. Replace spaces with underscores and avoid names such as
Q1orFY26. - A name that was accepted but has an odd suffix. If you copy a sheet that contains a table, Excel names the copy
Table1_2or similar. Rename the copy right away so the two tables do not get mixed up. - A formula still shows
Table1. The formula probably contains the word as plain text inside quotation marks, which Excel does not update. Edit it by hand.
Exercise
You rename Table1 to Sales Table and Excel rejects the name. What is wrong, and what would be a valid name?
Show answer
The name contains a space, which table names do not allow. Use SalesTable or Sales_Table instead.
Exercise
A workbook has a table named Orders. Can you name a second table on another sheet ORDERS? Explain.
Show answer
No. Table names are not case sensitive and must be unique across the whole workbook, so ORDERS conflicts with Orders.