Functions Lesson 8 of 13
Excel VLOOKUP, XLOOKUP and INDEX MATCH
Look up values from a table with VLOOKUP, the newer XLOOKUP, and INDEX with MATCH — prices by item code, names by LRN, and grade brackets with approximate match.
A lookup finds a value in a table and returns related information: the price of an item code, the name of a student from their LRN, the descriptor of a grade. Lookups connect sheets together, like joins in SQL.
The price list
| A | B | C | |
|---|---|---|---|
| 1 | Code | Item | Price |
| 2 | P01 | Pandesal | 25 |
| 3 | P02 | Kape 3-in-1 | 8 |
| 4 | P03 | Itlog | 9 |
| 5 | P04 | Noodles | 15 |
VLOOKUP
=VLOOKUP(lookup_value, table, column_number, FALSE)
| A | B | C | D | E | |
|---|---|---|---|---|---|
| 1 | Code | Qty | Item | Price | Amount |
| 2 | P03 | 6 | =VLOOKUP(A2, Prices!$A$2:$C$5, 2, FALSE) | =VLOOKUP(A2, Prices!$A$2:$C$5, 3, FALSE) | =B2*D2 |
| 3 | P01 | 2 | Pandesal | 25 | 50 |
For row 2: Excel finds P03 in the first column of the price table, then returns column 2 (Itlog) or column 3 (9). Amount = 54.
- The value you look for must be in the first column of the table.
- The column number counts from the table's first column (1, 2, 3…).
FALSEmeans exact match. Always use it for codes, names and IDs.- Lock the table with
$so it doesn't shift when copied down.
XLOOKUP (Microsoft 365, Excel 2021+, Google Sheets)
=XLOOKUP(lookup_value, lookup_range, return_range, "if not found")
=XLOOKUP(A2, Prices!A2:A5, Prices!B2:B5, "Unknown code")
XLOOKUP is easier and safer:
- The lookup column doesn't have to be first; it can even be to the right of the result.
- You give the return range directly instead of counting columns.
- Exact match is the default.
- A built-in "not found" message replaces
#N/A.
If your version has XLOOKUP, prefer it. Use VLOOKUP when sharing files with people who have older Excel versions.
INDEX and MATCH
Before XLOOKUP, the flexible option was combining two functions:
=INDEX(Prices!B2:B5, MATCH(A2, Prices!A2:A5, 0))
MATCH(A2, Prices!A2:A5, 0)finds the position of the code (P03 → 3). The0means exact match.INDEX(Prices!B2:B5, 3)returns the 3rd item in that range: Itlog.
You'll see INDEX/MATCH in many existing files; it works in every version.
Approximate match: grade brackets
Approximate match is useful for ranges, like converting a grade to a descriptor. The table must be sorted from lowest to highest:
| A | B | |
|---|---|---|
| 1 | Min grade | Descriptor |
| 2 | 0 | Did Not Meet Expectations |
| 3 | 75 | Fairly Satisfactory |
| 4 | 80 | Satisfactory |
| 5 | 85 | Very Satisfactory |
| 6 | 90 | Outstanding |
=VLOOKUP(B2, $F$2:$G$6, 2, TRUE)
For a grade of 87, Excel finds the largest minimum that's ≤ 87 (85) and returns "Very Satisfactory". This is shorter than a five-level nested IF, and changing a bracket only means editing the table. With XLOOKUP: =XLOOKUP(B2, $F$2:$F$6, $G$2:$G$6, , -1) (match mode -1 = exact or next smaller).
Looking up across sheets
Keep master lists (students, products) on their own sheet and look them up from other sheets. Changing a price in the master list updates every sheet that uses it.
Quick Quiz
Check what you learned. Walang grade ito, practice lang. 🙂
By Sir Reyel · Last updated 2026-12-04