# E9 | moonshotai/kimi-k3 | run 1

## Prompt

Write a spreadsheet formula that looks up the price of the product named in cell D2 from a table in columns A (names) and B (prices).

## Response

Use a `VLOOKUP` with an exact match to find the price for the product in D2. This works in both Excel and Google Sheets.

```excel
=VLOOKUP(D2, A:B, 2, FALSE)
```

**How it works**

- `D2` — the product name to find
- `A:B` — the lookup table (names in A, prices in B)
- `2` — return the value from the second column (prices)
- `FALSE` — require an exact match, so you never get a wrong price for a near-miss name

**Alternatives**

| Formula | Code | Best for |
|---|---|---|
| XLOOKUP | `=XLOOKUP(D2, A:A, B:B)` | Excel 365 / modern Sheets; simpler syntax, looks left or right |
| INDEX/MATCH | `=INDEX(B:B, MATCH(D2, A:A, 0))` | Older Excel versions; flexible column order |

**Handle missing products**

Wrap the formula so a typo in D2 shows a friendly message instead of `#N/A`:

```excel
=IFERROR(VLOOKUP(D2, A:B, 2, FALSE), "Not found")
```

See the official references for details: [Microsoft VLOOKUP docs](https://support.microsoft.com/en-us/office/vlookup-function-0bbc8083-26fe-4963-8ab8-93a18ad188a1) or [Google Sheets VLOOKUP docs](https://support.google.com/docs/answer/3093318).

Is your data in a fixed range (like A2:B100) rather than full columns, or would you like a version that handles approximate matches?
