The #NAME? error tells you that Excel read a word in your formula and could not match it to anything it knows: not a function, not a defined name, not a cell reference. The good news is that the cause is almost always visible in the formula itself. This guide shows how to fix NAME error in Excel step by step, with six common causes, the corrected formulas and a quick way to find every #NAME? cell in a workbook.
The fixes apply to Excel for Microsoft 365, Excel 2024, 2021 and 2019 on Windows and Mac, and Excel for the web. Google Sheets and LibreOffice Calc use the same #NAME? error, so most of the advice carries over.
What the #NAME? Error Means
Excel splits every formula into functions, references, operators and constants. When it meets text that fits none of those, it returns #NAME?. Microsoft describes it as a sign that something in the syntax needs to be corrected, not as a data problem.
That is the key difference from errors such as #N/A or #VALUE!. Those come from the data the formula receives. #NAME? means the formula itself cannot be understood, so it fails for every row until you correct it.
Common Causes of #NAME? at a Glance
The examples below use a small sales sheet: Rep in column A, Region in B, Q3 Sales in C and Q4 Sales in D, with data in rows 6 to 11.
| Cause | Broken formula | Fixed formula |
|---|---|---|
| Misspelled function name | =SUMM(D6:D11) | =SUM(D6:D11) |
| Name that is not defined (or is misspelled) | =SUM(Q4_Sale) | =SUM(Q4_Sales) after defining the name |
| Text without double quotes | =COUNTIF(B6:B11,North) | =COUNTIF(B6:B11,"North") |
| Missing colon in a range | =AVERAGE(C6C11) | =AVERAGE(C6:C11) |
| Curly quotes pasted from a web page or document | =IF(D6>C6,“Up”,“Down”) | =IF(D6>C6,"Up","Down") |
| Function not available in your Excel version | =XLOOKUP("Priya Nair",A6:A11,D6:D11) in Excel 2019 | =INDEX(D6:D11,MATCH("Priya Nair",A6:A11,0)) |
How to Fix NAME Error in Excel, Cause by Cause
1. A typo in the function name
This is the most common reason. =SUMM(D6:D11) and =VLOKUP(...) both return #NAME? because no such functions exist. Correct the spelling and the total of Q4 Sales becomes 278,100.
To avoid typos, start typing the function name and pick it from the Formula AutoComplete list with the Tab key. Excel inserts the correct name and the opening bracket, then shows the arguments as a tooltip. A function name that Excel recognises is converted to upper case when you press Enter, so a name that stays in lower case is a quick warning sign.
2. A defined name that does not exist
Formulas such as =SUM(Q4_Sales) only work if the name has been created. If it has not, or if the formula uses a slightly different spelling such as Q4_Sale, the result is #NAME?. To create it:
- Select D6:D11.
- Go to Formulas > Define Name.
- Type Q4_Sales as the name, choose Workbook as the scope and select OK.
Then insert it with Formulas > Use in Formula instead of typing it, so the spelling always matches. Open Name Manager (Ctrl+F3 on Windows) to check names that were deleted or have a sheet-level scope. Microsoft’s guide on how to define and use names in formulas covers scope in more detail.
3. Text values without double quotes
Every text value inside a formula must be wrapped in straight double quotes. In =COUNTIF(B6:B11,North), Excel treats North as an undefined name. Add the quotes:
=COUNTIF(B6:B11,"North")
The result is 2. A better habit is to point at a cell that holds the criterion, for example =COUNTIF(B6:B11,G6), so there is no text to quote at all.
4. A missing colon in a range reference
A range needs a colon between its first and last cell. =AVERAGE(C6C11) is read as a name, so it fails. =AVERAGE(C6:C11) returns 43,975. Selecting the range with the mouse while editing the formula avoids this mistake.
5. Curly quotes copied from the web
Formulas copied from emails, chat tools or word processors often arrive with typographic quotes (“ ”) instead of straight quotes (“). Excel does not accept curly quotes as text delimiters, so the word inside is treated as a name and the formula shows #NAME?. Retype the quotes in Excel, or use Find and Replace (Ctrl+H) on the formula cells to replace “ and ” with “.
=IF(D6>C6,"Up","Down")
6. A function your version of Excel does not have
Newer functions such as XLOOKUP, XMATCH, FILTER, LET and LAMBDA are not available in Excel 2019 and earlier perpetual versions. When a workbook built in Microsoft 365 is opened there, those formulas return #NAME?, and the formula bar may show an _xlfn. prefix in front of the function name. That prefix is Excel’s way of marking a function the current version does not recognise.
The fix is either to open the file in a version that supports the function, or to rewrite the formula with older functions:
=INDEX(D6:D11,MATCH("Priya Nair",A6:A11,0))
This returns 41,300, the same result as XLOOKUP. If you share files with colleagues on older versions, our guide to the XLOOKUP function lists which versions include it. A similar #NAME? result appears when a function depends on an add-in that is switched off, such as EUROCONVERT with the Euro Currency Tools add-in; enable it under File > Options > Add-ins.
Find Every #NAME? Error in a Workbook
- Go To Special: press F5, select Special, choose Formulas and tick only Errors. Excel selects every formula that returns an error.
- Find: press Ctrl+F, type #NAME?, open Options and set Look in to Values.
- Error Checking: Formulas > Error Checking steps through each error cell and offers Edit in Formula Bar.
- Evaluate Formula: Formulas > Evaluate Formula shows which part of a long formula Excel cannot read.
Should You Hide #NAME? With IFERROR?
No. Microsoft’s own guide on how to correct a #NAME? error advises against masking it with error-handling functions. Because the formula is broken, IFERROR would hide a result that can never be correct. Fix the spelling, the name or the quotes instead. IFERROR is better suited to data-driven errors, such as a lookup that finds no match.
#NAME? in Google Sheets and LibreOffice Calc
Google Sheets shows #NAME? for the same causes. Hover over the cell to see a message such as Unknown function, or Unknown range name for an undefined named range. Sheets supports XLOOKUP, so cause 6 is less common there, but Sheets-only functions such as QUERY return #NAME? when the file is opened in Excel.
LibreOffice Calc displays #NAME? and reports it as Err:525 (invalid name) in the status bar. Calc and Excel do not share every function, so check the function list of the target app before sending a workbook to someone who uses a different spreadsheet.
Practice Workbook
Download the practice workbook to repair six broken formulas on the sales sheet used in this guide. The Practice sheet shows each broken formula with a yellow answer cell, and the Solutions sheet contains the working formulas and expected results.
FAQ
Why does my formula show #NAME? on another computer only?
The other computer probably runs an older version of Excel that does not include a function you used, or an add-in that the formula needs is not enabled there.
What does _xlfn. mean in a formula?
It marks a function that the current version of Excel does not support. The formula returns #NAME? until it is opened in a newer version or rewritten.
Can a defined name cause #NAME? after it worked before?
Yes. Deleting or renaming the name in Name Manager, or copying the formula to another workbook without the name, breaks every formula that uses it.
Is #NAME? the same as #REF!?
No. #NAME? means Excel cannot recognise a word in the formula. #REF! means a cell reference points to something that was deleted, which our guide to fixing the #REF! error explains.
Download the practice workbook
The same data as this tutorial, with empty answer cells and a Solutions sheet.