# E9 | perplexity/sonar-pro | 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

You can use a **VLOOKUP** formula to return the price from column B based on the product name in D2. Assuming your product table is in A:B (with names in A and prices in B), the formula is:

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

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

If your setup is slightly different (e.g., names not in column A), would you like a version using INDEX/MATCH instead?
