"PivotTable Field Name Is Not Valid": How to Fix It
By ExcelReady TeamUpdated 5 min read
The short answer
Excel shows "The PivotTable field name is not valid" when a column in the source data has no header. Every column in the range needs a label in the first row. Type a header into any blank header cell, unmerge merged headers, and make sure the source range has no empty columns. Then create or refresh the pivot.
Key takeaways
- Every column in a PivotTable's source range needs a non-blank header in the first row.
- Merged header cells leave blank cells behind, so unmerge them and fill in each label.
- A source range that includes an empty column, or starts on the wrong row, causes the same error.
- =COUNTBLANK(A1:E1) quickly tells you how many headers are missing.
- Turning the data into an Excel table first keeps headers filled and the range up to date.
On this page+
"The PivotTable field name is not valid" means at least one column in your source data has no header. A PivotTable turns every column header into a field, the name you drag into Rows, Columns or Values, so a column without a header has no name and Excel stops. This guide shows the usual causes of the pivot table field name is not valid error and how to fix each one quickly, whether it appears when you create the pivot or when you refresh it.
Why Excel says the PivotTable field name is not valid#
Excel needs your data organised as a list: one header row on top, one record per row below it, and a label above every column. When any cell in the header row of the selected range is blank, Excel can't name that field, so it shows the message and doesn't create the PivotTable.
Look at this sales data. The header in D1 is missing:
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Date | Region | Product | Amount | |
| 2 | 4 Mar 2024 | East | Paper | Online | 120 |
| 3 | 5 Mar 2024 | West | Ink | Store | 85 |
| 4 | 5 Mar 2024 | East | Ink | Online | 60 |
| 5 | 6 Mar 2024 | South | Paper | Store | 140 |
Select A1:E5, choose Insert > PivotTable, and Excel shows the error. Type Channel into D1 and the PivotTable is created without a problem.
The common causes, in order of how often they happen:
- A blank header cell somewhere in the first row.
- Merged header cells.
- A source range that includes an empty column or starts on the wrong row.
- A header that was deleted after the PivotTable was built, which shows up on refresh.
Fix 1: fill in blank header cells#
The fastest fix is to find the empty header and type a name. In a wide sheet, a blank header is easy to miss, so let a formula find it for you:
=COUNTBLANK(A1:E1)On the data above, the result is 1. Anything above 0 means a header is missing. Select the header row and scan it, or use Home > Find & Select > Go To Special > Blanks to select the empty cells directly.
Watch out for headers that look blank but aren't, and the other way round. A header that holds only a space looks empty but counts as text. A header that holds a formula returning "" also looks empty. Give every column a short, clear name such as Channel, Amount or Order Date.
Fix 2: unmerge merged header cells#
Merged cells cause the same error because only the top-left cell of a merge keeps its text. If "Sales" is merged across D1:E1, Excel sees "Sales" in D1 and a blank in E1.
- Select the header row.
- Choose Home > Merge & Center to unmerge the cells.
- Type a separate header into every cell, for example "Sales Online" and "Sales Store".
Two header rows, such as a group title above the column names, cause a similar problem. Keep only one header row directly above the data. If you need the group title for printing, put it higher up with an empty row between it and the data, and don't include it in the PivotTable range.
Fix 3: check the source data range#
Sometimes the headers are fine but the range is wrong. If the selected range includes an empty column on the right, or starts one row too low, Excel finds a blank "header" and stops.
For a new PivotTable, check the Table/Range box in the Create PivotTable dialog before you click OK. Selecting a single cell inside the data and letting Excel pick the range is usually safest, as long as the data has no fully empty rows or columns in the middle.
For an existing PivotTable:
- Click inside the PivotTable.
- Go to PivotTable Analyze > Change Data Source.
- Look at the range. Make sure it starts at the header row and ends at the last real column.
- Fix the range and click OK.
Fix 4: the error appears when you refresh#
If the PivotTable worked yesterday and now fails on refresh, something in the source changed. Usually someone deleted or cleared a header, inserted a new column without a name, or pasted new data over the header row. Fill in the header and refresh again (Windows: Alt+F5; or right-click the PivotTable and choose Refresh).
The guide to refreshing a pivot table explains Refresh versus Refresh All, and why new rows sometimes don't appear.
How to stop the error coming back#
The best long-term fix is to turn the source data into an Excel table before you build the PivotTable. Click inside the data and press Ctrl+T (Mac: ⌘T).
An Excel table always gives every column a header. If you add a column, it gets a default name like Column1 instead of a blank. The table also grows when you add rows, and a PivotTable built on it picks up the new rows on the next refresh. The article on tables versus PivotTables explains how the two work together.
A few more habits help:
- One header row, one record per row, no blank rows or columns in the middle.
- Unique header names. Excel allows two columns called "Amount" and renames the second one Amount2, but clear names make the field list much easier to use.
- No headers that are only numbers or dates if you can avoid it. They work, but text labels are easier to drag and read.
Related PivotTable messages#
A similar-looking message appears when you rename a field inside the PivotTable to a name the source already uses, for example renaming "Sum of Amount" to "Amount". Excel says the name already exists. Add a space at the end (Amount ) or use a different name such as "Total Amount".
If you're new to PivotTables, start with the beginner's guide to pivot tables. Once your pivot works, you can count rows with a pivot table or add a calculated field for things like profit or margin.
Practise it#
Practise building PivotTables in a live spreadsheet: you'll create a PivotTable from clean data, drag fields into Rows and Values, and change Sum to Count, with instant feedback at each step. Warm up with the header check exercise on this page.
Try it yourself
This is a live spreadsheet. Type the formula in the green cell and press Enter.
Before building a PivotTable, check the headers. Click G2 and use COUNTBLANK on the header row A1:E1 to count missing headers. Press Enter.
| A | B | C | D | E | F | G | H | |
|---|---|---|---|---|---|---|---|---|
| 1 | Product | Amount | Missing headers | |||||
| 2 | ||||||||
| 3 | ||||||||
| 4 | ||||||||
| 5 | ||||||||
| 6 | ||||||||
| 7 | ||||||||
| 8 |
Tip: COUNTBLANK takes one range and counts the empty cells in it.
Practise this in a lesson
Frequently asked questions
What does the PivotTable field name is not valid mean?
It means at least one column in the source data has no header, so Excel has no name to give that field. Excel needs a label above every column it uses.
How do I fix the PivotTable field name is not valid error on refresh?
Open PivotTable Analyze, then Change Data Source, and look at the range. Fill in any blank header cells, or shrink the range so it no longer includes empty columns, then refresh.
Can merged cells cause the PivotTable field name error?
Yes. When header cells are merged, only the first cell keeps the text and the others are blank. Unmerge them and type a header into each cell.
Can two columns have the same header in a PivotTable?
Excel allows it and adds a number to the second one, such as Amount2. It's clearer to give every column a unique name before you build the pivot.