Excel’s “Reference isn’t valid” message means the action you tried to perform points to a cell range, worksheet, workbook, or defined name that Excel cannot use. Check the reference involved in the action—often a chart source, PivotTable source, or named range—and correct it or select a valid range again.
What the message means
This is usually a dialog-box error, not an error displayed in a worksheet cell. Excel is telling you that a feature cannot resolve the reference it was given. A reference might point to a deleted sheet, a range that no longer exists, an unavailable workbook, or a name whose definition is broken. In some cases, the reference is valid in principle but entered in a format the feature does not accept.
The wording is broad because different Excel features use references in different ways. A chart expects data it can plot, a conventional PivotTable needs a usable source, and a defined name must point to a valid location or expression. The right repair therefore depends on what you were doing when the message appeared. Closing the dialog and repeating the action without checking that context may simply produce the same error.
When does Excel show it?
Pay attention to the action immediately before the message. Did you insert or edit a chart, refresh a PivotTable, open Name Manager, set a print area, or create a rule that uses a range? That clue narrows the investigation. If the message appeared while opening a workbook, a damaged or unavailable external link may be involved; if it appeared while editing a particular feature, start with that feature’s source reference.
It can also matter whether the workbook is saved. A reference to another workbook may work while that file is open but fail when Excel cannot locate it later. A worksheet name or range copied from another file may not match the current workbook. Save a copy before making broad changes, especially if the workbook contains important charts, reports, or connections.
Common causes to check first
- Deleted or renamed source: A chart, name, or other feature may still point to a sheet or range that was removed. Excel often updates its own internal references when a sheet is renamed, but manually entered references and links to other workbooks can still be wrong.
- Incorrect sheet or range notation: A sheet name containing spaces or punctuation needs to be represented correctly in a reference. A misspelled name, missing apostrophe, or incorrect range boundary can make a source unusable.
- Broken defined name: A workbook name may refer to a deleted range or display
#REF!in its definition. Features that use that name can then fail. - Missing external workbook: A reference may depend on a file that was moved, renamed, or is not accessible. A link to a workbook on a disconnected drive or unavailable network location is one example.
- Invalid or unsuitable source data: A chart or PivotTable may be given an empty selection, a range that does not include the intended headers, or a source that does not fit the feature’s requirements.
- Stale selection or dialog entry: A source box may contain an old range, or the selected cells may not be the ones you intended. Selecting the data again is often safer than editing a complicated reference by hand.
Fix a chart data reference
For a chart, select the chart and open Chart Design > Select Data. Inspect the chart data range and the listed series. If the range is wrong, select the range-selection button beside the data range box, then select the intended cells on the worksheet and confirm the selection. Check that the series names and category labels point to the right rows or columns. A chart may have several separate series, so verify each one rather than assuming that correcting the overall range fixed every entry.
For example, if a chart should plot monthly figures from a table but the source range points to a sheet that was deleted, choose the current table range instead. Include the relevant labels if they should appear in the legend or along the category axis. If the chart uses nonadjacent ranges, check each series reference individually; selecting one rectangular block may not reproduce the original chart setup.
If the source is on another worksheet, select the cells directly where possible rather than typing a reference from memory. A worksheet name with spaces requires careful reference syntax. If the chart is based on a table, confirm that the table still exists and contains the expected columns. On Mac, chart controls are also available from the chart-design ribbon, though the ribbon layout can differ from Windows.
Repair a PivotTable source
For a conventional PivotTable based on worksheet cells, click inside the PivotTable and choose PivotTable Analyze > Change Data Source. Review the table or range shown. If it points to a deleted sheet or omits new rows, select the correct source range on the worksheet and confirm. Then refresh the PivotTable. The source should have a header row with a distinct, nonblank heading for each column; merged headings and blank header cells can cause separate setup problems even when the range itself exists.
A frequent situation is that new records were added below the original source range. The PivotTable may continue to work but exclude those records, or a changed source reference may be invalid. If the data is regularly extended, consider converting the source into an Excel table: select the data and use Insert > Table, making sure the header option is appropriate. A PivotTable built from a table can include rows added to that table after a refresh, reducing the need to adjust a fixed cell range each time.
This advice applies to worksheet-based PivotTables. A PivotTable built from the Data Model or an external connection does not necessarily use a simple worksheet range as its source. In that case, inspect the relevant connection, query, or model instead of trying to replace it with an ordinary cell range. The available controls can vary with the workbook’s source and Excel version.
Check names and other range-based features
Open Formulas > Name Manager to review defined names. Select a name used by the feature that failed and inspect its Refers to entry. If it points to a deleted sheet or shows #REF!, edit the definition to point to the correct cells, or delete the name if it is obsolete and safe to remove. Be cautious: a name may be used in formulas, charts, or validation rules elsewhere in the workbook.
Names can have workbook scope or be limited to a particular worksheet. If two names look alike, check their scope as well as their definition. A feature may be using a sheet-level name when you expected a workbook-level name. Do not delete every name that looks unfamiliar; names can support report formulas, templates, or hidden workbook logic.
Other features can also store range references. For a print-area problem, select the intended cells and use Page Layout > Print Area > Set Print Area. For a data-validation rule, inspect the source in the validation settings and confirm that any referenced list or name still exists. Correct the reference in the feature that owns it rather than changing unrelated workbook settings.
Check worksheet and external workbook references
When a reference includes a worksheet name, verify that the sheet exists and that the spelling is exact. Names containing spaces or certain punctuation are normally enclosed in apostrophes in a sheet reference; for example, the sheet name Quarter 1 is written with apostrophes around the name when used in a reference. Selecting the target cells with the mouse is a practical way to avoid typing errors.
For a link to another workbook, confirm that the source file still exists at the expected location and that you can open it. If it was moved or renamed, use Excel’s link-management options, where available for that workbook, to locate or update the source. Do not replace a link with a guessed path: the correct file may contain a different version of the data. If you do not need an external link, decide deliberately whether to keep a fixed snapshot or rebuild the dependent feature using data in the current workbook.
“Reference isn’t valid” versus #REF!
These messages are related but not identical. “Reference isn’t valid” is generally a dialog that stops an action because Excel cannot use a supplied reference. #REF! is a worksheet error value that appears when a formula contains a broken cell reference, often because referenced cells or sheets were deleted. A workbook can contain one without the other: a broken formula does not automatically mean a chart source is invalid, and a dialog error does not prove that every formula in the workbook is broken.
If you see #REF! in a cell, inspect the formula in that cell and determine which reference was lost before editing it. Replacing the text with a nearby cell address may produce a result but can silently change the calculation’s meaning. If the dialog is the problem, start with the feature’s source settings instead of searching every worksheet formula.
A safe troubleshooting sequence
- Record what you were doing. Note the feature, button, and dialog that led to the error. If practical, cancel out without saving changes.
- Save a separate copy. This preserves a fallback before you edit names, sources, or links.
- Inspect the relevant source. Use Select Data for a chart, Change Data Source for a worksheet-based PivotTable, or Name Manager for a defined name.
- Confirm the destination exists. Check the workbook, sheet, range, headers, and any external file involved.
- Re-select the range where possible. Use the worksheet selection control instead of relying on a manually typed reference.
- Test the feature. Reopen or refresh it, check that the expected data appears, and save only after confirming the result.
If the reference looks correct but the message persists, close and reopen the workbook, then check whether the source file is available and whether the workbook is being edited in desktop Excel. Excel for the web and Mac may present different ribbon layouts or have different feature availability, so follow the equivalent controls in that version rather than assuming every Windows path is identical.
How to prevent the error
Use Excel tables for data that grows, keep clear headers, and avoid deleting sheets or names until you know what depends on them. When moving a workbook, move its linked source files too or update the links intentionally. For important reports, document where chart and PivotTable sources come from. These habits do not prevent every invalid reference, but they make the source easier to identify and repair.
Frequently Asked Questions
Why does Excel say “Reference isn’t valid” when I create a chart?
Excel cannot use the selected chart source as entered. Open Chart Design > Select Data, check the data range and each series, and select the intended cells again. Confirm that the source sheet and workbook are available.
How do I fix “Reference isn’t valid” in a PivotTable?
For a worksheet-based PivotTable, click inside it and use PivotTable Analyze > Change Data Source to choose a valid range with proper headers. If it uses the Data Model or an external connection, inspect that source instead.
Does this message mean my formulas are broken?
Not necessarily. It usually reports a problem with the reference used by the action you just attempted. Look for #REF! in cells if you suspect broken formulas, but troubleshoot a chart, PivotTable, or name separately.
Can a deleted worksheet cause this error?
Yes. A feature or defined name may still depend on a deleted sheet. Check the source settings or Name Manager and point the affected item to an existing sheet and range if the original data is available.
Why does the error appear only when another workbook is closed?
The reference may depend on an external workbook that Excel cannot locate or access. Check that the source file has not been moved or renamed, and update the link only after confirming the correct source file.
Related
- Excel Quick Analysis Button: What It Does and How to Use It
- Excel Solver: Find a Target Sum with Changing Cells
- Solver in Excel: How to Enable and Set It Up
Try it: the Formula Explainer: paste any formula and see each function and reference in plain English.
More in Errors & fixes
- How to Fix Zoom in Excel and Restore a Readable ViewTo fix zoom in Excel for Microsoft 365 on Windows, open the View tab and choose Zoom to…
- Lookup Value Not Working in Excel? Fix the CauseA lookup value usually fails in Excel because the lookup and source values do not match exactly, the…
- Excel Print Area Not Working? Common FixesIf Excel is printing the wrong cells or ignoring a print area, select the intended range and choose…
- Excel File Open in Another Application Error: FixesIf Excel says a file is open in another application, first close the workbook everywhere it may be…
- Excel Freeze Panes Not Freezing Selection? Fix ItExcel Freeze Panes does not lock the cell or range you select; it keeps the rows above and…
- Excel Error: Convert an Entire Column to Real NumbersTo fix Excel’s “number stored as text” error across a column, select the affected cells and choose the…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.