INDEX and MATCH
A flexible lookup that works in every version of Excel and Google Sheets and can look left.
The formula
Excel and Google Sheets
=INDEX(Products!$C$2:$C$100, MATCH(A2, Products!$A$2:$A$100, 0))How it works
MATCH(A2, Products!$A$2:$A$100, 0)Finds the position of A2 in the code column. 0 means exact match.
INDEX(Products!$C$2:$C$100, …)Returns the value at that position from the price column.
Example
| A: Code | B: Result (price) |
|---|---|
| P-101 | 12.50 |
| P-310 | 4.75 |
| P-205 | 89.00 |
Tips
- Wrap it in IFERROR(…, "Not found") to hide #N/A.
- Inserting columns in the table does not break it, unlike VLOOKUP's column number.