# LET formula generator

> Describe what you need and get a LET formula for Excel and Google Sheets, run on real data before you copy it. Plus 8 tested LET examples.

Source: https://spreadsheetpractice.com/tools/formula-generator/let · Updated October 29, 2026 · Formulas and results on this page were run by the Spreadsheet Practice formula engine on November 20, 2026

LET gives names to values or calculations inside a single formula, then uses those names in a final calculation.

Describe the task at [LET formula generator](https://spreadsheetpractice.com/tools/formula-generator/let) and get a LET formula for Excel and Google Sheets, tested on real data.

## Tested LET examples

### Use LET to simplify a long IF formula

`=LET(m,(B2-C2)/B2,IF(m<0,"Loss",IF(m<$G$1,"Thin","Healthy")))`

Excel. Result on the sample sheet: 6 rows (D2:D7). [See it and try it](https://spreadsheetpractice.com/formulas/let-to-simplify-an-if-formula)

### Show a blank instead of 0

`=LET(t,SUMIFS($C$2:$C$7,$B$2:$B$7,E2),IF(t=0,"",t))`

Excel. Result on the sample sheet: 5 rows (F2:F6). [See it and try it](https://spreadsheetpractice.com/formulas/show-blank-instead-of-zero)

### Scale values to 0-100%

`=(B2-MIN($B$2:$B$9))/(MAX($B$2:$B$9)-MIN($B$2:$B$9))`

Excel. Result on the sample sheet: 8 rows (C2:C9). [See it and try it](https://spreadsheetpractice.com/formulas/normalize-values-to-percentages)

### Calculate the payback period

`=LET(n,COUNTIF(C2:C7,"<0"),n-1-INDEX(C2:C7,n)/INDEX(B2:B7,n+1))`

Excel. Result on the sample sheet: 3.31. [See it and try it](https://spreadsheetpractice.com/formulas/calculate-the-payback-period)

### Group invoices into aging buckets

`=LET(days,$G$1-B2,IFS(days<=0,"Current",days<=30,"1-30",days<=60,"31-60",days<=90,"61-90",TRUE,"Over 90"))`

Excel. Result on the sample sheet: 7 rows (D2:D8). [See it and try it](https://spreadsheetpractice.com/formulas/aging-buckets-for-invoices)

### Interpolate between values in a lookup table

`=LET(i,MATCH(E1,A2:A8,1),dLo,INDEX(A2:A8,i),dHi,INDEX(A2:A8,i+1),vLo,INDEX(B2:B8,i),vHi,INDEX(B2:B8,i+1),vLo+(E1-dLo)*(vHi-vLo)/(dHi-dLo))`

Excel. Result on the sample sheet: 262.3. [See it and try it](https://spreadsheetpractice.com/formulas/interpolate-lookup-table)

### Why does VLOOKUP return 0 instead of a blank

`=LET(p,XLOOKUP(E2,$A$2:$A$6,$C$2:$C$6),IF(p="","",p))`

Excel. Result on the sample sheet: 4 rows (F2:F5). [See it and try it](https://spreadsheetpractice.com/formulas/vlookup-returns-0-instead-of-blank)

### Find the first Monday of the month

`=LET(first,EOMONTH(A2,-1)+1,first+MOD(2-WEEKDAY(first),7))`

Excel. Result on the sample sheet: 6 rows (B2:B7). [See it and try it](https://spreadsheetpractice.com/formulas/first-monday-of-the-month)

## Questions

### What does the LET formula generator do?

You describe the task in plain English, and it writes the formula, using LET where that's the right tool, for your table or a sample one. The formula is run in our engine in Excel and Google Sheets mode before you see it, so you get its result, not just a guess.

### What does LET do?

LET gives names to values or calculations inside a single formula, then uses those names in a final calculation.

### Can I learn to write LET formulas myself?

Yes. Each example below opens a page where you try the formula in a live grid and it's checked as you go, and the LET function page has a practice exercise.

---

Spreadsheet Practice (https://spreadsheetpractice.com) teaches spreadsheet formulas by practice: every exercise is graded in a live grid and re-checked on changed data.
