How to fix the #NAME? error in Excel

#NAME? means Excel does not recognize a function or a name in the formula. It is not a missing match. A missing match is #N/A.

The shelf is the one on Why VLOOKUP returns #N/A. A100 has 12 on hand. A200 has 48. A300 has 6. Those three add to 66.

A misspelled function

SUM of B2:B4 is 12 + 48 + 6 = 66. SUMM is not a function. Excel looks for a name called SUMM, does not find one, and returns #NAME?.

SUM
=SUMM(B2:B4)
=SUMM(B2:B4)D4
Misspelled SUM
ABCD
1SKUOn handFormula
2A10012
3A2004866
4A3006#NAME?
A picture of the shelf from the VLOOKUP page. A100, A200, and A300 are 12, 48, and 6. SUM is 66. SUMM is not a function, so that cell is #NAME?.
=SUM(B2:B4)
=SUMM(B2:B4)

The formula bar is the place to look. Formulas, Insert Function, will not offer SUMM. Neither will a defined name in Name Manager, unless someone created one. Delete the extra M. Microsoft’s support page How to correct a #NAME? error says a typo in the formula name is the top reason for this error, and it says not to use IFERROR to mask it.

A space inside the name does the same thing. =S UM(B2:B4) is #NAME?. A space after the equals sign is allowed. = SUM(B2:B4) is 66.

Text has to be in quotes

The rates are the five statewide rates on the XLOOKUP page. Texas is 6.25%. That 6.25% is the Tax Foundation statewide rate as of January 1, 2026, the figure already on that page. It is not a city rate.

TX without quotes is a name, not the text TX. There is no name TX in the workbook, so the lookup is #NAME?. The quoted lookup returns 6.25%.

XLOOKUP
=XLOOKUP("TX",A2:A6,B2:B6)
=XLOOKUP("TX",A2:A6,B2:B6)E3
Quoted TX
ABCDE
1StateRateCheckResult
2CA7.25%Unquoted#NAME?
3FL6.00%Quoted6.25%
4MA6.25%IFERRORAdd this state
5NY4.00%IFNA#NAME?
6TX6.25%
A picture of the five statewide rates. The unquoted formula types TX with no quotes, so Excel looks for a name and returns #NAME?. The quoted formula returns 6.25%. IFERROR of the unquoted lookup returns the words, which hides the typo. IFNA does not.
=XLOOKUP(TX,A2:A6,B2:B6)
=XLOOKUP("TX",A2:A6,B2:B6)

IFERROR of the unquoted lookup, with Add this state as the fallback, returns those words. The IFERROR page uses the same words for a real miss, Wyoming, which is #N/A and not #NAME?. Wrapping the typo makes a missing name look like a missing state.

IFNA only replaces #N/A. The unquoted TX is still #NAME? after IFNA. Use IFNA when the only acceptable miss is #N/A. Leave IFERROR off until the formula itself is recognized.

Curly quotes copied from a web page fail the same way. "TX" has to be the straight quote character. A curly pair is not a text delimiter, and the cell is #NAME?.

A missing colon is the same error when the two ends run together. =SUM(B2B4) looks for a name called B2B4. The range is B2:B4. Microsoft’s page lists that missing colon next to the missing quotes.

The function has to exist in this Excel

XLOOKUP is in Microsoft 365, Excel 2021, Excel 2024, and Excel for the web. Excel 2016 and Excel 2019 do not have it. On those versions the quoted formula is still #NAME?. The function name is spelled correctly. That Excel does not have it.

VLOOKUP of the quoted state returns the same 6.25% and works in those older versions:

=VLOOKUP("TX",A2:B6,2,FALSE)

FALSE is the exact match. Column index 2 is the rate. UNIQUE is the same kind of #NAME? in Excel 2019. The count of Austin, Dallas, Austin, and Houston is on How to count unique values in Excel. ROWS of UNIQUE is 3 where UNIQUE exists, and #NAME? where it does not.

A LAMBDA that was never saved

xl.count.unique of those four cities is 3 after the name is in Name Manager. Before that, the call is #NAME?. Excel is looking for a name that this workbook does not define.

=xl.count.unique(A2:A5)

LAMBDA itself is #NAME? in Excel 2021, even when that Excel already has XLOOKUP. The name needs Microsoft 365, Excel 2024, or Excel for the web. Saving it is the Name Manager step in the LAMBDA how-to.

IFERROR around the unsaved name returns the fallback and hides the missing definition. The same rule as the unquoted TX: see the #NAME? first, then decide whether a fallback belongs there.


More from the blog