The packing desk prices parts by code. Enter P-01, P-03 and P-07 in A2:A4, and prices 4, 9 and 16 in B2:B4. The code column starts the lookup range.

Match P-03 and return its price

Put P-03 in D2 and enter =VLOOKUP(D2,$A$2:$B$4,2,FALSE) in E2. Expect 9. The 2 refers to the price column within A:B. Keep the catalog address fixed if you copy the formula to more order lines.

The catalog matches P-03 to the second-column price of 9.

Illustrated successful lookup with an exact code.

Try a code between existing entries

Replace D2 with P-04 and expect #N/A. Check hyphens and stray spaces if a valid code seems to be missing. If two catalog rows use P-03, VLOOKUP uses the first match, so check for duplicates before using the prices.

P-04 sits between P-03 and P-07 in sort order and produces #N/A.

Illustrated missing-key check.

Related Microsoft Excel reference