Skip to content

Fix LET #NAME? or #ERROR! in Google Sheets (name typo, reserved name, or a name used before it is defined)

Updated

LET assigns names inside one formula, then uses them in the last argument. #NAME? here is usually a typo of those names (shiftt vs shift), or a name that is not defined in this LET. #ERROR! (or a LET-specific refusal) shows up when the name is illegal — a cell-style id like A1, a reserved word, or a name used before the pair that defines it. The formula parsed enough to be LET. The names did not.

This page is LET names. It is not unknown function (VLOKUP is not VLOOKUP; LET itself is spelled correctly). It is not named range #REF! / #NAME? (Data → Named ranges). Keep the Google Sheets UI in English. The helper name is LET.

  1. Open a blank spreadsheet. In A1 type hours. A2 8. B1 extra. B2 2. Dock shift length and overtime hours.

A LET that works. In D1 type let_ok. In D2 enter =LET(shift,A2,ot,B2,shift+ot). The cell shows 10. Two names, each defined before they are used in the sum. That row is the control.

D2 selected. Formula bar shows =LET(shift,A2,ot,B2,shift+ot). D2 is 10 with no error triangle. A2 is 8. B2 is 2.

Typo in the formula part. In D4 type typo. In D5 enter =LET(shift,A2,ot,B2,shiftt+ot). The cell shows #NAME?. shift was defined. shiftt was not. Leave D5 broken.

Name used before it is defined. In D7 type order. In D8 enter =LET(total,ot+A2,ot,B2,total). ot appears in the first value (ot+A2) before the pair ot, B2. Sheets cannot resolve that ot yet. The cell errors (#NAME? or #ERROR! depending on build). Leave D8 broken.

Reserved / cell-style name. In D10 type a1name. In D11 enter =LET(A1,A2,A1+B2). A1 is already a cell address. LET will not use it as a local name. The cell shows #ERROR! (or a formula parse / LET argument error). Leave D11 broken.

D11 selected. Formula bar shows =LET(A1,A2,A1+B2). D11 is #ERROR!. D5 is still #NAME? from shiftt. D2 is still 10.

Unknown function contrast. In F2 enter =VLOKUP(A2,A2:B2,2,FALSE). #NAME?, Unknown function: ‘VLOKUP’. That is unknown function. Leave F2 as the contrast. Do not add a LET wrapper to “name” VLOKUP.

Leave D5, D8, and D11 as the broken formulas. Leave D2 as 10.

  • LET(name1, value1, name2, value2, …, result) evaluates names in order. Each value may use names already defined to its left. It may not use a name that appears later. D8’s ot+A2 is too early.
  • Names are local to that formula. Spelling must match exactly (shift ≠ shiftt). They are not case-sensitive (Shift is shift), but extra letters are not optional.
  • Names must look like identifiers, not A1/R1C1 addresses, not TRUE / FALSE. A1 is the cell in the corner of the sheet. Calling a LET name A1 is D11.
  • LET does not register Data → Named ranges. shift in D2 will not appear in that sidebar. Other cells cannot use shift unless they repeat LET or you create a named range on purpose.

This is not VLOKUP. See unknown function. D5’s tooltip is an unknown name inside LET, not Unknown function: ‘LET’. If the tooltip is Unknown function: ‘LET’, the spreadsheet is too old or the name is misspelled LTE. That is the name-error primer.

This is not a deleted named range. See named range #REF! / #NAME?. Open Data → Named ranges. shift should not be there from D2. If you also created a named range shift, you now have two different mechanisms. This recreate does not need that sidebar.

This is not a Formula parse error from commas vs semicolons. See locale parse error. D2 uses the same commas as D5.

This is not #N/A. Nothing is being looked up. See what #N/A means.

Leave D5, D8, and D11 broken so the name errors stay on the sheet. Leave D2 as 10.

Spell the name you defined. In G5 enter =LET(shift,A2,ot,B2,shift+ot). The cell matches D2. Read the last argument. Every identifier there must be a LET name, a real range (A2), a function (SUM), or a literal.

G5 selected. Formula bar shows =LET(shift,A2,ot,B2,shift+ot). G5 is 10 with no error triangle. D5 is still #NAME?. D11 is still #ERROR!. F2 is still VLOKUP #NAME?.

Define before use. In G8 enter =LET(ot,B2,total,ot+A2,total). ot is assigned first. total uses it. Same 10.

Pick a legal name. In G11 enter =LET(base,A2,base+B2). base is not a cell address. Avoid C2, R1, TRUE, SUM as names even if a build accepts some of them — they are confusing next to real functions and addresses.

Do not wrap D5 in IFERROR while shiftt is still in the formula. See IFERROR vs IFNA. IFNA will not catch #NAME? from a typo in some cases and will not catch #ERROR! from D11.

If LET is #NAME?, read the last argument for a word that does not appear as a name, pair. If it is #ERROR!, look for A1-style names or a name used before its assignment. If Unknown function names LET or VLOKUP, you are on the generic #NAME? page.

A named range (Data → Named ranges) is spreadsheet-wide. Deleting it is #NAME?. Deleting its cells is #REF!. See named range #REF! / #NAME?.

A LET name exists only while that formula calculates. It does not appear in the named-range sidebar. Other tabs cannot call shift from D2.

Do not create a named range shift to debug D5. Fix shiftt. If many formulas need the same alias, use a named range. If only this formula needs a readable intermediate, use LET. You can still read a named range from LET: =LET(hours,A2,hours*rate) when rate is file-scoped and hours is local.