# E9 | perplexity/sonar-pro | run 2

## 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** formula that references the product name in D2 and the name/price table in columns A and B:

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

This formula looks up the value in **D2** in column **A** of the table and returns the corresponding price from column **B**, using an exact match (`FALSE`).[VLOOKUP basics](https://support.microsoft.com/en-us/excel/functions/vlookup-function)[Example formula](https://exceljet.net/formulas/lookup-up-cost-for-product-or-service)

If your data range is limited (for example, rows 2 to 100), you can make it more efficient:

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

Would you like a version that also handles missing or invalid product names without showing an error?
