“Reference isn’t Valid” Excel Error: How to Fix (2023)
When you’re working in Excel to organize and analyze your data, you may encounter different types of Excel errors ⚠️
Getting Excel errors is so frustrating because it hinders you from getting work done 😩
The “Reference isn’t Valid” error is one of the many Excel errors that you may encounter when you’re working on Pivot Tables.
But such an error can be fixed!
In this article, you’ll learn the three common reasons for the “Reference isn’t Valid” Excel error so you’ll know how to fix it 😀
Download this free practice workbook so we can work on it.
Table of Contents
Problem #1: Reference to an invalid range
The most common reason for you to get the reference isn’t valid error is invalid references.
This can happen when the data reference has been deleted, moved, or renamed.
You can do these simple steps to check this.
- Open the attached Excel file. It has two sheets “Summary” and “Data”. A Pivot table is created on the Summary sheet. Pivot Table data refers to the data table in the “Data” sheet.
- Go to the Pivot table Analyze tab and Refresh your data source reference. There will be no reference error and your Pivot Table is error-free.
- Now, go to the Formulas tab and click the “Name manager” icon from the “Defined Names” group.
- You can see all the named ranges in this “Name Manager” window. In the current scenario, the data range of the data source reference is defined as “Packages”. Select that and click the “Edit…” button.
- Change the named range with a new name in the “Edit Name” dialog box. For example, you can change the “Packages” to “Sales”. Then, click the “OK” button. Close the name manager window also.
- Again, go to the Pivot table Analyze tab and refresh your data source reference. “Reference isn’t valid” error occurs for your Pivot Table.
This reference isn’t valid Excel error occurs as there is no valid range for the name range “Packages”. In other words. “Packages” is a non-existent range in this Excel file.
You can solve data source reference errors using one of the below methods.
- Change the name of the named range to the original name. So, you can rename the entire range of data source references as “Packages”.
- If you don’t choose rename, you can follow the below steps.
- Go to the Pivot Table Analyze tab and click “Change Data Source”.
- Delete the existing table name “Packages” from the Table/ Range box. Then, type the new table name “Sales” there.
Problem #2: Excel file is not on a local drive
Sometimes you get this error when the Excel file you are working on is not saved on your local drive 💻
You can follow the below steps to test this.
- Create a copy of the “Data” sheet to a new Excel file. You can right-click on the sheet name and select “Move or Copy…”.
- Create a new Pivot Table on your file locally saved. This Pivot Table’s data source refers to the unsaved file. This unsaved Excel file is in a temporary folder.
- Then, close the new file with source data without saving it.
- Now, go to the Pivot Table Analyze tab and click “Change Data Source”.
- Click the “OK” button of the “Change Pivot Table Data Source” dialog box.
- You will get the “Data source reference is not valid” error message.
The solution to this issue is always to save a copy of the file to your local drive.
If you are using an Excel file that is in Read-only mode to create a Pivot Table, make sure to save that Excel file to your local disk.
Problem #3: Brackets in the file name
Sometimes the square brackets [ ] in the Excel file name also can be the reason for the “reference isn’t valid” Excel error message.
You can test this as follows.
- Insert square brackets for the file name before the .xlsx file.
- Now, try to create a new Pivot Table using data in the “Data” sheet.
Then, you will get the “Data source reference is not valid” error.
The reason is that Pivot Tables do not support predefined characters.
Square brackets are such characters. So, Pivot tables identify them as invalid characters or forbidden characters.
The solution in this current scenario is to remove square brackets from the file name.
- Go to the file explorer.
- Select the Excel file.
- Press F2
- Remove the square brackets of the file name.
That’s it – Now what?
Well done! Now, whenever Excel sends you the Reference isn’t valid excel error message, you already know what to do to fix it 😉
This reference error happens not only when working on Pivot tables. It can also happen in broken hyperlinks and What-if analysis formulas.
Thus, it’s really important to build formulas and function correctly.
Learn how to build advanced Excel functions that actually help you in your day-to-day work. Functions like the VLOOKUP, IF, and SUMIF.
Enroll in my 30-minute free online course here to learn these (and many more) in the most simple way possible 👍
If you want to refresh your knowledge about Pivot Tables, don’t forget to read our article about How to Create a Pivot Table in Excel.
You can always refer to our article about the Full List of ALL Excel Errors and How to Fix Them when you encounter an Excel error.