In Excel, an invalid name error usually means a formula contains a name Excel cannot recognize, such as a misspelled function or an undefined named range; the cell commonly displays #NAME?. Check the formula bar, correct the spelling or reference, and use Formulas > Name Manager to confirm that any named range exists. If Excel shows a warning while you are creating a name, check that name against Excel’s naming rules.
What Excel’s invalid name error means
The phrase can refer to two different problems. A cell displaying #NAME? means Excel could not interpret some text in the formula as a valid function, defined name, or other recognized formula element. It does not necessarily mean the worksheet contains a badly named range: the problem could simply be a typo in the formula.
A separate warning can appear when you try to create or change a defined name. In that case, Excel is rejecting the name itself, often because it contains a space, starts with a number, or looks like a cell reference. The fix is to choose a name that follows Excel’s rules, not to change a formula elsewhere.
Look at where the message appears before troubleshooting. An error inside a worksheet cell points to a formula. A warning during a naming action points to the proposed name. Distinguishing these situations saves time because the checks and fixes are different.
How Excel uses names
A defined name is a label for a cell, range, constant, or formula. Instead of writing a range address such as B2:B20 in many formulas, you can give that range a descriptive name such as MonthlySales. Names can make formulas easier to read, but Excel must be able to match each name in a formula to a name that is defined in the workbook.
Names have a scope. A workbook-level name can be used throughout the workbook, while a worksheet-level name applies only on its particular sheet. Two sheets can have local names that are identical, so a formula may refer to a different range depending on the sheet where the formula is entered. In Formulas > Name Manager, check the Scope and Refers to columns when a name seems to exist but a formula still returns an error.
Names are not case-sensitive, so MonthlySales and monthlysales are treated as the same name. They are also distinct from ordinary text: if a formula needs the word Yes as text, Excel generally needs it enclosed in double quotation marks. Without the quotation marks, Excel may try to interpret Yes as a defined name.
Common causes of #NAME?
Excel returns #NAME? when it encounters text in a formula that it cannot resolve. Common causes include:
- A misspelled function: typing SUMM instead of SUM, for example, makes Excel look for a function or name it does not recognize.
- An undefined or mistyped range name: a formula might refer to
QuarterSaleseven though the actual name isQuarterlySales, or the name may have been deleted. - Text without quotation marks: a formula that compares a cell with the word Yes must treat Yes as text, rather than leave Excel to interpret it as a name.
- A name with the wrong scope: a worksheet-level name may not be available where you are using it, or a local name may take precedence over a workbook-level name.
- A function unavailable in the Excel version opening the file: newer functions such as XLOOKUP are available in Microsoft 365 and Excel 2021 or later, but an older Excel release may not recognize them.
- A damaged or altered reference: a workbook may contain a formula referring to a name that was renamed or removed, leaving the formula’s reference behind.
Some of these issues produce a different error or a formula-entry warning depending on the formula and Excel version. Read the exact message and inspect the cell result rather than assuming every formula problem is an invalid name.
Rules for creating a valid Excel name
Excel names have specific restrictions. For a name that will be easy to reuse, follow these rules:
- Start with a letter, an underscore (
_), or a backslash (\). Do not start with a number. - After the first character, use letters, numbers, periods, or underscores. Spaces and most punctuation marks are not allowed.
- Do not use a name that could be read as a cell reference, such as
B2orR1C1. - Keep the name within Excel’s 255-character limit.
- Remember that names are case-insensitive, so capitalization cannot distinguish two names.
For instance, Sales_Total and TaxRate2026 are practical examples of names. If you want a label with spaces, use an underscore or remove the spaces; a worksheet tab can have spaces, but a defined name cannot. Avoid names that differ only in capitalization because Excel treats them as identical.
How to diagnose the problem in a workbook
On Excel for Microsoft 365 for Windows, start with the cell that shows #NAME?. Select it and read the formula bar from left to right. Check every function name and every word that is not enclosed in quotation marks. If the formula uses a defined name, compare its spelling carefully with the name shown in Name Manager.
- Open Formulas > Name Manager. Review the list for the name used in the formula.
- Check the Scope column to see whether the name is workbook-level or limited to a worksheet.
- Check Refers to to confirm that the name points to the intended cells or formula. A name can exist but point somewhere unexpected.
- Look for a spelling difference, an extra character, or an obsolete name in the formula.
- After correcting the formula or name, press Enter and check whether the result updates.
If the cell contains a newer function and the workbook was created in another Excel release, verify that the function is supported by the version being used. An older release may show a compatibility marker such as _xlfn. or fail to calculate a function it does not have. Replacing the function with an older equivalent may be necessary if the file must work in that release.
In Excel for Mac, the same basic checks apply; use the Formulas tab and its defined-name tools to inspect names. Ribbon placement and keyboard shortcuts can differ from Windows. Excel for the web also has a more limited editing experience for some workbook features, so use the desktop app if you cannot inspect or change the relevant name there.
How to repair a defined name
In Name Manager, select the incorrect name and choose Edit to change its name or its Refers to range. If the name is no longer needed, you can select it and choose Delete. Be cautious when deleting: formulas that depend on that name may then display errors. If several names look similar, confirm their scope and destinations before making changes.
You can also create a name from the ribbon. Select the cell or range, choose Formulas > Define Name, enter a valid name, confirm its scope and reference, and select OK. Another option is to select the range and type a valid name into the Name Box to the left of the formula bar, then press Enter. When using the Name Box, make sure the intended range is selected first.
If you are unsure whether changing the name will affect other formulas, inspect the Refers to field and search the workbook for the old name before deleting it. Excel’s Name Manager is useful for checking what a name points to, but it does not guarantee that every formula using the name has the intended business meaning.
Formula examples and expected results
With values 4, 6, and 10 in cells A1:A3, this formula has valid formula structure but misspells the function name. Excel does not have a standard function called SUMM, so the result is #NAME?:
=SUMM(A1:A3)
With the same values still in A1:A3, correcting the function name gives a total of 20:
=SUM(A1:A3)
For a name example, suppose cells B2:B4 contain 100, 150, and 200, and the workbook has a defined name QuarterSales that refers to B2:B4. A formula using that defined name returns 450:
=SUM(QuarterSales)
If the defined name was actually created as QuarterlySales, the spelling in the formula must match that name. If you need to compare a cell with the text Yes, put the text in double quotation marks within the formula; otherwise Excel may search for a defined name called Yes.
Preventing name errors
Choose names that describe their purpose and use a consistent pattern, such as TaxRate or Product_List. Check a proposed name in Name Manager before creating a duplicate, and verify its scope when a workbook has multiple sheets. When editing or deleting names, consider formulas and reports that may depend on them.
For formulas, use Excel’s autocomplete suggestions where available, and review names and function spellings before copying a formula across a large range. If a workbook is shared with people using older Excel versions, check that its functions are supported there. A name error is often small, but a broken reference can affect many dependent calculations.
Frequently Asked Questions
What does #NAME? mean in Excel?
It means Excel cannot recognize part of a formula as a valid function or name. Check for misspelled function names, undefined named ranges, and text that should be enclosed in quotation marks.
How do I find a name that is causing an error?
Select the error cell and inspect its formula bar. Then open Formulas > Name Manager and compare names in the formula with the listed names, scopes, and Refers to entries.
Can a space be used in an Excel named range?
No. A defined name cannot contain spaces. Use an underscore or remove the space, for example Annual_Sales instead of Annual Sales.
Why does Excel say a name is invalid when I create it?
The name may start with a number, contain a space or unsupported punctuation, exceed the character limit, or resemble a cell reference. Choose a shorter name that starts with a letter or underscore.
Why does a function work on one computer but show #NAME? on another?
The computers may use different Excel versions, and the older version may not support that function. Confirm the function’s version requirements or use a compatible alternative if the workbook must open in the older release.
Related
- Microsoft Excel: Remove Page Break Lines and Hide Them
- Microsoft Excel Scatter Plot: How to Create and Read One
- Microsoft Excel Power Query: What It Does and How to Use It
Try it: the Formula Explainer: paste any formula and see each function and reference in plain English.
More in Errors & fixes
- How to Normalize Dates in Excel and Fix Inconsistent FormatsTo normalize dates in Excel, first convert any text dates into real Excel date values, then apply one…
- Hide #DIV/0! Errors in Excel FormulasTo hide a #DIV/0! error in an Excel formula, wrap the calculation in IFERROR: with the numerator in…
- Excel Box and Whisker Plot Not Working? Fixes to TryIf an Excel box-and-whisker plot is missing, blank, or arranged incorrectly, first check that you are using a…
- Excel Page Break Won’t Move? Fix the Common CausesIf an Excel page break will not move, switch to View > Page Break Preview and drag the…
- Excel MID Formula Not Working? Common Fixes That WorkIf Excel’s MID formula is not working, first check that its starting position and character count are correct:…
- Excel VLOOKUP Not Working With Text? Fix the MatchIf VLOOKUP is not finding text in Excel, first use an exact match and check that the lookup…
Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources
Spotted an error in this guide? Let us know.