Sub topic 4
Getting the header row right
This chapter assumes you can select cells, enter formulas, use the Ribbon and Ctrl+T, and read A1-style references. The header row is the first row of an Excel table. It holds the column names. Every later feature depends on those names: structured references, calculated columns, filter buttons and slicers.
What the header row does
When you create a table, Excel uses the top row of the range as the header row. Each header cell becomes the name of a column. Formulas refer to those names, as in SalesTable[Amount]. If a name is wrong, every formula that uses it is harder to read.
The header row also shows the filter buttons. Excel replaces the column letters (A, B, C) with the table's headers when you scroll down. This only happens while a cell inside the table is selected.
Rules for header cells
Excel enforces three rules when it builds the header row.
- Each header must be text. If a header cell holds a number or a date, Excel converts it to text. A header of
2025becomes the text2025. - Each header must be unique. If two cells hold the same value, Excel appends a number. A second
AmountbecomesAmount2. - Each header must be non-empty. A blank header cell gets a default name such as
Column1.
The "My table has headers" checkbox
When you press Ctrl+T, the Create Table dialog opens. It shows the detected range and a checkbox labelled My table has headers.
- If the box is checked, Excel treats the first row as the header row and keeps your text.
- If the box is cleared, Excel inserts a new row above your data. It fills that row with
Column1,Column2and so on.
Excel guesses the setting. It usually checks the box when the first row is text and the rows below contain numbers. It can guess wrong when all of your data is text. Always read the dialog before you click OK.
Checking and editing headers
Click a header cell and type to rename it. Excel updates every formula that refers to the old name. For example, if you rename Unit Price to Price, the formula below changes by itself.
=[@Quantity]*[@[Unit Price]]After the rename, the formula reads as follows.
=[@Quantity]*[@Price]Names that contain spaces need double brackets in a structured reference, as in [@[Unit Price]]. Names with no spaces or special characters need only single brackets. Short names without spaces make formulas easier to type and read.
Common errors
| Problem | Cause | Fix |
|---|---|---|
| Headers read `Column1`, `Column2` | The checkbox was cleared, or Excel guessed wrong | Undo, then recreate the table with the box checked |
| A header shows `Amount2` | Two columns had the same name | Rename one column to something distinct |
| A year header became text | Excel converts all headers to text | Use a label such as `FY2025` |
| The header row is not the first row | Titles or blank rows sit above the headers | Move the headers to the top of the range, or select the range yourself before pressing Ctrl+T |
| A formula in a header vanished | Headers cannot hold formulas | Keep the formula in a helper cell outside the table |
Header row checklist
Before you click OK, check these points.
- The first row holds one short label per column.
- No label repeats.
- No cell in the header row is blank.
- No header is a formula.
- The range has no blank rows or columns inside it.
Exercise
You select A1:C20 and press Ctrl+T. The first row contains the text Region, Sales and Sales. The box is checked. What headers will the table have, and why might you still want to change them?
Show answer
The headers will be Region, Sales and Sales2. Excel makes duplicate headers unique by adding a number. Sales2 says nothing about what the column holds, so you should rename it to something meaningful, such as Sales Target, before writing structured references.
Exercise
Your data starts in row 3, with a title in row 1 and a blank row 2. What should you do so the table gets the correct header row?
Show answer
Select the range that starts at the header row (row 3) and press Ctrl+T. You can also delete the title and blank rows. Excel only detects the header correctly when the header row is the first row of the range.