# How to use LET to simplify a long IF formula in Excel

Name the repeated calculation once with LET, then use the name in the IFs: =LET(m,(B2-C2)/B2,IF(m<0,"Loss",IF(m<$G$1,"Thin","Healthy"))).

**Excel:** `=LET(m,(B2-C2)/B2,IF(m<0,"Loss",IF(m<$G$1,"Thin","Healthy")))` (Excel 2021, 2024 and Microsoft 365)

**Google Sheets:** the same formula works.

## Example

Sample data (row 1 is the header):

| A | B | C | D | E | F | G |
| --- | --- | --- | --- | --- | --- | --- |
| Product | Price | Cost | Margin check |  | Thin below | 0.2 |
| Lamp | 39.99 | 31.5 |  |  |  |  |
| Chair | 249 | 238 |  |  |  |  |
| Cable | 9.99 | 11.25 |  |  |  |  |
| Desk | 449 | 299 |  |  |  |  |
| Mouse | 24.5 | 20.1 |  |  |  |  |
| Mat | 15 | 12 |  |  |  |  |

Formula in D2, filled to D7: `=LET(m,(B2-C2)/B2,IF(m<0,"Loss",IF(m<$G$1,"Thin","Healthy")))`

Result: Healthy; Thin; Loss; Healthy; Thin; Healthy

## How it works

LET takes name and value pairs followed by a final calculation. Here `m` holds the margin, so the IFs read `m<0` and `m<$G$1` instead of repeating `(B2-C2)/B2` each time. The Mat's margin is exactly 20%, which is not below the threshold, so it is Healthy.

## Other ways

- `=IF((B2-C2)/B2<0,"Loss",IF((B2-C2)/B2<$G$1,"Thin","Healthy"))`: Without LET the margin is written twice. Works in every version.
- `=LET(m,(B2-C2)/B2,IFS(m<0,"Loss",m<$G$1,"Thin",TRUE,"Healthy"))`: LET with IFS reads like a list of rules.

## Common mistakes

- A LET name can't look like a cell address: `m1` or `tax2026` fail. Use names like `margin`.
- The last argument is the result; every name and value pair comes before it.
- LET needs Excel 2021, Microsoft 365 or Google Sheets. Older Excel shows #NAME?.

## Questions

**Can LET define several names?**

Yes, as pairs: `=LET(price,B2,cost,C2,m,(price-cost)/price,IF(m<0,"Loss","OK"))`.

**Does LET make formulas faster?**

When a calculation repeats, yes: LET works it out once and reuses the result.

Every formula and result on this page was checked by running it in the Spreadsheet Practice formula engine on 2026-10-30.

Source: https://spreadsheetpractice.com/formulas/let-to-simplify-an-if-formula
