The name is left of the code. Find the name for the code in A5.
AB
1NameCode
2Item AP110
3Item BP245
4Item CP390
5P390

In A5, write =INDEX($A$2:$A$4,MATCH(B5,$B$2:$B$4,0)) and it shows Item C.

The two halves

MATCH(value, list, 0) returns where the value sits in the list, counted from 1. The 0 asks for an exact match.

INDEX(range, position) returns the item at that position. Both ranges must cover the same rows, and then MATCH can feed INDEX: INDEX(prices, MATCH(code, codes, 0)).

Why people prefer it

Keep the ranges fixed

Write both ranges with dollar signs. If they are relative they slide when the formula is filled down, and the lookup quietly searches the wrong rows.

Practise it

Module 3, Lookups, has 20 tasks on this, each checked on hidden data: open module 3. You can also try formulas in the sandbox.

Related guides