Sub topic 7
Fixing #NAME?: misspelled names and functions
This chapter assumes you can enter and edit formulas, use cell references and ranges, and know the basic functions SUM, AVERAGE and VLOOKUP. You should also know the difference between numbers and text in a cell.
What #NAME? means
Excel returns #NAME? when it reads a word in your formula and cannot match it to anything. The word might be a function, a defined name, a table name, or a piece of text that is missing its quotation marks. Excel does not guess what you meant. It stops and shows the error.
The error is about recognition, not about the values in your cells. Cell contents are almost never the cause, so look at the formula text itself.
Cause 1: a misspelled function
The most common cause is a typo in a function name. Excel has no function called SUMM, so this formula fails:
=SUMM(A1:A5)Correct the spelling and the error goes away:
=SUM(A1:A5)A useful habit is to type the function name in lowercase. Excel converts a recognized name to uppercase when you finish the formula. If the name stays lowercase, Excel did not recognize it, and you can spot the typo before you press Enter. Function autocomplete, which shows a list of matching names as you type, also helps you avoid typos.
Cause 2: text without quotation marks
In a formula, text must sit inside double quotation marks. Without them, Excel treats the word as a name.
=IF(A2>100,High,"Low")returns #NAME? becauseHighhas no quotes.=IF(A2>100,"High","Low")works.
Cause 3: a name that does not exist
A defined name is a label you give to a cell or range, such as TaxRate. A formula that uses a name returns #NAME? if the name was never created, was deleted, or is spelled differently from the definition. To check, open the Formulas tab and choose Name Manager. Compare the spelling there with the formula. Names also have a scope, either the whole workbook or a single sheet. A name defined for one sheet is not recognized on another.
Cause 4: a missing colon in a range
A range such as A1:A5 needs its colon. If you write =SUM(A1A5), Excel reads A1A5 as a name, not as a range, and returns #NAME?.
Cause 5: a function your version does not have
Newer functions such as XLOOKUP and FILTER do not exist in older versions of Excel. If you open a workbook that uses them in Excel 2016, the formula returns #NAME?. The formula is correct, but the program cannot run it. Either replace it with an older equivalent such as INDEX and MATCH, or ask the author for a version that works in your Excel.
A quick checklist
- Click the cell and read the formula in the formula bar.
- Check each function name for spelling.
- Check that every piece of text is inside double quotation marks.
- Open Name Manager and confirm each defined name exists and is spelled the same way.
- Check that every range has its colon.
- Confirm your Excel version supports each function.
Common mistakes
| Formula | Problem | Fix |
|---|---|---|
| `=SUMM(A1:A5)` | Misspelled function | `=SUM(A1:A5)` |
| `=IF(A2>100,High,"Low")` | Text without quotes | Put `"High"` in quotes |
| `=A2*TaxRat` | Name misspelled | Use `TaxRate` |
| `=SUM(A1A5)` | Missing colon | `=SUM(A1:A5)` |
Exercise
A coworker's formula =IF(B2="Yes",Approved,"Pending") returns #NAME?. What is wrong, and what is the corrected formula?
Show answer
The word Approved is not in quotation marks, so Excel treats it as a name that does not exist. Put it in quotes: =IF(B2="Yes","Approved","Pending")
Exercise
A workbook that worked on your colleague's computer shows #NAME? in every cell that uses XLOOKUP when you open it in Excel 2016. The spelling is correct. What is the likely cause?
Show answer
Excel 2016 does not include XLOOKUP, so it cannot recognize the function. Replace it with INDEX and MATCH, or open the file in a version of Excel that supports XLOOKUP.