LET in Google Sheets: name the piece your formula repeats
One VLOOKUP typed three times, one copy with a shorter range, and #N/A in a single row. Rewrite it with LET and fix the errors LET throws.
On this page
=IF(VLOOKUP(E4,$A$2:$C$9,3,FALSE)>=20000, VLOOKUP(E4,$A$2:$C$9,3,FALSE)*0.05, VLOOKUP(E4,$A$2:$C$8,3,FALSE)*0.02)Before three VLOOKUPs
| E | F | |
|---|---|---|
| 1 | Rep | Bonus |
| 2 | Marcus | 364 |
| 3 | Priya | 1000 |
| 4 | Maria | #N/A |
| 5 | Luis | 1550 |
| 6 | Tom | 196 |
What changed
- The lookup is written once, as
sales - Every use reads
$A$2:$C$9
After LET
| E | F | |
|---|---|---|
| 1 | Rep | Bonus |
| 2 | Marcus | 364 |
| 3 | Priya | 1000 |
| 4 | Maria | 308 |
| 5 | Luis | 1550 |
| 6 | Tom | 196 |
The bonus formula in F2:F6 is meant to look up each rep's Q3 sales and multiply them by 0.05 at 20000 and up, or by 0.02 below, and it needs the same VLOOKUP three times to do that. Wrap the lookup in LET, give it a name such as sales, and the formula carries one copy instead of three. In the take-home sheet that one change also clears the #N/A in Maria's row, because the single copy that is left searches the full range, $A$2:$C$9, where the third copy stopped a row short.
Each cell in column F holds the same formula with its own row number. The lookup appears once for the test and once for each possible result. This is the copy in F4, the cell that broke.
=IF(VLOOKUP(E4,$A$2:$C$9,3,FALSE)>=20000, VLOOKUP(E4,$A$2:$C$9,3,FALSE)*0.05, VLOOKUP(E4,$A$2:$C$8,3,FALSE)*0.02)
With LET the same cell holds the formula below, and F4 returns 308 where the #N/A was.
=LET(sales, VLOOKUP(E4,$A$2:$C$9,3,FALSE), IF(sales>=20000, sales*0.05, sales*0.02))
In a formula of your own, the piece to name is whichever expression is typed more than once. It goes second, right after the name, and the rest of the formula goes last with the name standing in for every copy.
Why does VLOOKUP say "Did not find value" for a name that is in the table?
One copy of the lookup searches a shorter range than the other two. The third VLOOKUP in F4 searches $A$2:$C$8, and Maria is on row 9. Selecting F4 brings up a red note that reads Did not find value 'Maria' in VLOOKUP evaluation. The other four bonuses came out fine, 364 for Marcus, 1000 for Priya, 1550 for Luis and 196 for Tom.
Put the three lookups next to each other and the difference is one character, a 9 in the first two ranges and an 8 in the last. With an exact match, the VLOOKUP help page says the function returns #N/A when no matching key exists, and inside the shorter range there is no Maria.

Changing $C$8 to $C$9 by hand clears the error. It also leaves three copies in every cell of F2:F6, and the next edit has the same chance of missing one. The cleaner repair is to write the lookup once and refer to it by name, which is what LET is for.
How do I rewrite a repeated VLOOKUP with LET?
Name the lookup once, then write the IF with the name in place of every VLOOKUP. Google's LET function page gives the pattern as a name, the value stored under that name, and a final formula_expression that uses the name. In this sheet the name is sales, its value is the lookup, and the IF works only with sales:
=LET(sales, VLOOKUP(E2,$A$2:$C$9,3,FALSE), IF(sales>=20000, sales*0.05, sales*0.02))
To reuse it elsewhere, keep that shape and swap in your lookup: your search cell for E2, your table for $A$2:$C$9 and your column number for the 3. Pick a name that is not also a cell address. That mistake is the first LET error further down.
- On the Try it yourself tab, select
F2, delete what is there, and paste the formula above. - Copy F2, select
F3:F6, and paste. TheE2part shifts to E3, E4 and so on, while the dollar signs keep$A$2:$C$9fixed. - Compare F2:F6 with the Fixed tab. Both should read 364, 1000, 308, 1550 and 196.

That 308 is 15400 times 0.02, the lower rate, because Maria is under the cutoff. The other four cells return the numbers they had before, since their lookups were never the problem. The range now appears once per cell, so widening it later means one edit instead of three.
The help page adds that each value expression is evaluated only once, even when its name is used several times after that. Names are case-insensitive too, so sales and SALES point at the same value. Typing it in lowercase, as above, keeps names easy to tell apart from function names in the formula bar.
| Input | Q3 sales in C2:C9, reps in E2:E6 |
|---|---|
| Formula | =LET(sales, VLOOKUP(E2,$A$2:$C$9,3,FALSE), IF(sales>=20000, sales*0.05, sales*0.02)) |
| Expected | 364, 1000, 308, 1550, 196 |
| Sheets returned | 364, 1000, 308, 1550, 196 Matches expected |
| Checked | 2026-11-11, free personal account |
Why does the wrong VLOOKUP copy break only one row?
A wrong copy fails only on a row that reaches it and whose lookup value sits outside its range. Maria is the only rep in E2:E6 who is under 20000 and also below row 8. The third lookup only runs when the IF test fails, which means sales under 20000. Three of the five reps land there, Marcus with 18200, Maria with 15400 and Tom with 9800. Priya has exactly 20000, and because the test is >=20000, she takes the higher rate and never reaches the third copy.
Marcus sits in A3 and Tom in A7, both inside $A$2:$C$8, so the short range still finds them and their bonuses of 364 and 196 are correct. Maria in A9 is past the end of it. Checking the first two rows of column F would have shown 364 and 1000, both right, with the error two cells further down.
What does "Argument 1 of function LET is not a valid name" mean?
It means the first name in the LET looks like a cell address. The LET mistakes tab keeps five versions of the rewrite in I2:I6, labeled in column H, and three of them fail with notes of their own. In I2 the name is Q3, which is also the address of a cell in column Q, and the cell returned #NAME? with the note Argument 1 of function LET is not a valid name. The LET page says a name can't be a cell range like A1. Short names built from a letter or two and a number, like a quarter or a tax year, run into this.

Why does LET expect an odd number of arguments?
Because the last argument has to be the calculation, after any number of name and value pairs. I3 defines sales and rate but stops there, with no final formula. It returned #N/A and the note Wrong number of arguments to LET. Expected an odd number, but got 4 arguments. Adding sales*rate as a fifth argument is what turns the same start into the working formula in I5.

Why does LET return #NAME? with "Unknown range name"?
A name was used before the LET reached the place where it is defined. I5 and I6 use the same two names in opposite orders. With sales first, then rate, then sales*rate, Luis gets 1550, the same as on the Fixed tab. With rate defined first, its IF refers to sales before sales exists, and the cell returns #NAME? with Unknown range name: 'SALES'. The help page says names are read left to right and must be declared before they are used.

The quiet one is I4. Its IF multiplies by rate in the branch for 20000 and up, and rate is never defined anywhere in the formula. The cell still returned 308, the right bonus for Maria, because her 15400 sends the IF down the other branch, the one that never mentions rate.
A mistake in a branch that no row has reached stays silent, in LET as in the original three-copy formula. Before copying a rewrite down, try it on one rep under 20000 and one at or above it, the way Maria and Luis sit on opposite sides of the cutoff in this sheet.
Take-home copy. Four tabs: Broken, Fixed, Try it yourself, LET mistakes. It opens as a copy in your own Drive.